- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Changing UID's
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
03-06-2002 01:34 PM
03-06-2002 01:34 PM
Changing UID's
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2002 01:39 PM
03-06-2002 01:39 PM
Re: Changing UID's
Do one in SAM and then look at sam log, you should be able to unpick what sam did and then script what you want.
Test on test server.
HTH
Paula
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2002 01:41 PM
03-06-2002 01:41 PM
Re: Changing UID's
Create a textfile with login and new UID, a pair per line. Call it 'userlist'.
#!/usr/bin/sh
cat "userlist" | while read USER UID
do
echo "User: ${USER} New UID: ${UID}"
usermod -u ${UID} ${USER}
done
That should do it. You also need a find script to change the ownership of all his files.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2002 02:30 PM
03-06-2002 02:30 PM
Re: Changing UID's
You may find the attached script useful to get you started. It reads the existing passwd file and produces the following output:
user
This should help to get you started.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2002 07:47 PM
03-06-2002 07:47 PM
Re: Changing UID's
I once wrote a script while I was at University to perform such a task. I was migrating a few old HP boxes into out new NIS system and all the usernames and ID's and groups needed changing, so I wrote this little script. Have a look, it works really well (although I haven't used it for 3 years! Hopefully it still works...and the code is pretty rough in places, like I said, I was at university at the time). It will also optionally modify group files and group ID's, which is handy.
One bug: I assumed when I wrote it that hashing out an entry in the password file meant that it was no longer available. Wrong, it simply means that that user id now has a username which happens to begin with a hash (#) now. eg #testuser instead of the old testuser name. Simply delete any usernames in /etc/passwd with a hash infront of them, these are old, the new user entry will be the same except with the new user id.
Just simply create a little script which will call the cfown.sh script for each user/group id you want to change and run that one night when everything is quiet. I suggest changing group id's before user id's.
Hope this helps, I haven't used it for some time now and I can't remember if there were any limitations. I think now that there are probably some better command line arguments to 'find' which would suit us better than the ones I used.
cheers,
- Andy Gray
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2002 10:57 PM
09-27-2002 10:57 PM