LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-04-2010, 10:05 AM   #1
j-me
Member
 
Registered: Jan 2003
Location: des moines, ia
Distribution: suse RH
Posts: 123

Rep: Reputation: 16
Change UID for a user ... things to consider


I have a uid that I need to change however I need to know the process of doing so as this user is a vital user that has ownership of several running pids on this server. (webserver)

This user (admin) has a uid of 1003 on this server (server-A). However, on all our other servers (server-B-G)the uid is 1001. The reason for changing the uid is that the nfs mount that is mounted on server-A and on all the servers does not work right due to the uid difference. We have diagnosed to this point.
My question ... admin is the owner of several running pids. So in order to change the uid, do I need to:
- stop ALL pids owned by admin
- >usermod -u 1001 admin
- then start back up the jobs that admin runs

I have verified that there are no files/dirs owned by uid 1003 but the ownership is admin.

I can run a find >find / -uid 1003 - to locate any orphaned files/dirs before I start back up any jobs that require admin ownership.
Then >chown the file/dir.

Does this appear to be a viable plan to get this uid corrected?

Thanks!
 
Old 03-04-2010, 10:27 AM   #2
nuwen52
Member
 
Registered: Feb 2009
Distribution: Debian, CentOS 5, Gentoo, FreeBSD, Fedora, Mint, Slackware64
Posts: 208

Rep: Reputation: 46
yes... sounds like a good start. I would also make a check for group id also. Just in case some things which that user can touch are simply because the group is allowed. (ex: a shared cache file) Sounds un-necessary, but the admin user could be a member of another group.

Last edited by nuwen52; 03-04-2010 at 10:32 AM.
 
Old 03-04-2010, 10:55 AM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Quote:
Originally Posted by j-me View Post
I have a uid that I need to change however I need to know the process of doing so as this user is a vital user that has ownership of several running pids on this server. (webserver)

This user (admin) has a uid of 1003 on this server (server-A). However, on all our other servers (server-B-G)the uid is 1001. The reason for changing the uid is that the nfs mount that is mounted on server-A and on all the servers does not work right due to the uid difference. We have diagnosed to this point.
My question ... admin is the owner of several running pids. So in order to change the uid, do I need to:
- stop ALL pids owned by admin
- >usermod -u 1001 admin
- then start back up the jobs that admin runs

I have verified that there are no files/dirs owned by uid 1003 but the ownership is admin.

I can run a find >find / -uid 1003 - to locate any orphaned files/dirs before I start back up any jobs that require admin ownership.
Then >chown the file/dir.

Does this appear to be a viable plan to get this uid corrected?

Thanks!

Sounds quite sane indeed. It's a bit odd though that you guys have
system accounts in the 1000+ range - who dreamt that up? It's quite
uncommon, shall I say? Most Linux distros have system IDs under 500.



Cheers,
Tink
 
Old 03-04-2010, 11:16 AM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Quote:
Originally Posted by Tinkster View Post
It's a bit odd though that you guys have
system accounts in the 1000+ range - who dreamt that up? It's quite
uncommon, shall I say? Most Linux distros have system IDs under 500.
Quite so, Tinkster!

I pontificated about it in this LQ post (actually about gids but applies equally to uids).
 
Old 03-04-2010, 11:54 AM   #5
j-me
Member
 
Registered: Jan 2003
Location: des moines, ia
Distribution: suse RH
Posts: 123

Original Poster
Rep: Reputation: 16
Was the server guys that did the uid in the 1000+ range. They are regular window server dudes that are reluctantly converting to linux. Thanks for the input. I just wanted to make sure I had thought this through completely and not left anything out.

Thanks!
 
Old 03-04-2010, 01:27 PM   #6
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 164Reputation: 164
Verify your file permissions after the change, what appears to be owned by 'admin' is really the user friendly way of showing what is owned by that uid.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Way (ways) to change uid of a process psea Linux - Security 10 03-20-2009 02:27 PM
how to change uid group id mfrangos79 Linux - General 1 11-07-2005 07:19 PM
How can I change a user's uid and gid? homesp Debian 2 05-31-2005 02:39 PM
how to change UID linuxidiot2 Linux - General 2 07-30-2004 04:17 PM
After UID change can no longer ftp meshking Linux - General 4 07-13-2004 02:44 AM


All times are GMT -5. The time now is 06:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration