- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: What's the best way to RENAME user?
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
Forums
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
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
02-23-2004 09:40 AM
02-23-2004 09:40 AM
I'd like to know what's the best and safe way to RENAME them without any risk...
After the username changes, is there any special steps to deal with those files owned by this user ?
What kind of things I need to pay attention when I do this change ?
Thanks !
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2004 09:47 AM
02-23-2004 09:47 AM
Re: What's the best way to RENAME user?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2004 09:47 AM
02-23-2004 09:47 AM
Re: What's the best way to RENAME user?
# man usermod
# usermod -l new_login old_login
This should change /etc/passwd AND /tcb/files/auth/?/login_name if your system is trusted.
Since permissions are based on the UID number rather than the actual name, you should be OK in that respect.
I would do this during *NON-WORKING HOURS* and make sure your users know that when they come in for work on whatever the next day is, that their user ids will have been changed. Also make sure your help desk know (if you have one) knows about. I would also create a list with each users old id and their new id so you, or your help desk, can get the users pointed in the right direction ASAP.
I would also make sure you don't have any password issues. As far as I know usermod doesn't change the password, but it is something to keep in mind.
Good luck.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2004 09:47 AM
02-23-2004 09:47 AM
Re: What's the best way to RENAME user?
You can also use usermod to change the home directories, if you want, but that won't automatically copy the files to the new directory. You may have to play with this a little, but I think you will find usermod the way to go. I am sure with just a little thought you could script this easily.
Good luck
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2004 09:48 AM
02-23-2004 09:48 AM
Re: What's the best way to RENAME user?
*uid* and *gid* are the ones that matter not the names.
If you are just renaming the user (not changing the uid), then it is safe to do it. You will see the permissions changed automatically to the new user name. The inode information doesn't contain the user name but only the uid.
On the contrary it doesn't work the same way if you change the uid. Once the uid is changed, then you will have to individually change the ownerships of the files.
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2004 09:51 AM
02-23-2004 09:51 AM
Re: What's the best way to RENAME user?
which way will be better ? SAM or usermod ?
Thanks !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2004 09:53 AM
02-23-2004 09:53 AM
Re: What's the best way to RENAME user?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2004 09:56 AM
02-23-2004 09:56 AM
Re: What's the best way to RENAME user?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2004 09:57 AM
02-23-2004 09:57 AM
Re: What's the best way to RENAME user?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2004 10:01 AM
02-23-2004 10:01 AM
Re: What's the best way to RENAME user?
I'd do this with a script as Clay suggested.
Create a text file with the old user name and new user name on one line.
Then script it so that for each line in the file you do:
usermod -l ${new_name} {old_name}
mv /home/${old_name} /home/${new_name)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2004 10:15 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2004 10:25 AM
02-23-2004 10:25 AM
Re: What's the best way to RENAME user?
yes, i tried yours just now, and i think i need to add:
# rm -R
After:
# usermod -d
is that right ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2004 10:28 AM
02-23-2004 10:28 AM
Re: What's the best way to RENAME user?
Yes thats correct, it will leave the old home directory. You can remove it once you are sure everything has been properly copied to the new home directory.
Cheers
Con