- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to change the uid and gid of a user and updat...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2016 10:35 PM
09-18-2016 10:35 PM
How to change the uid and gid of a user and update all files,symbolic links with new uid/gid?
How can we change the uid and gid of a user and also update the user id/gid for all files ,symbolic links owned by that user/group on the system ?
Please provide me all the steps for the same.
- Tags:
- User id
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2016 11:55 AM - edited 09-19-2016 11:59 AM
09-19-2016 11:55 AM - edited 09-19-2016 11:59 AM
Re: How to change the UID and GID of a user and update all files, with new UID/GID?
I don't know if sam allows you to change IDs? (I see a modify with the UID field.)
There is also usermod(1m) not sure if it changes the file ownership?
If not, you could use vipw(1m) to edit /etc/passwd. And then you need to edit /etc/group for secondary groups.
Then you need a find(1) to search for all files with that UID or GID and then use chown/chgrp to change the values.
If the files don't have the same UID/GID, your -exec script for chown/chgrp will have to check the current owner/group and if it doesn't match, then don't do the ch*.
There is no need to worry about ownership of symlinks.