Solved

change UID for accounts in Linux (Redhat)

Posted on 2006-11-15
4
1,020 Views
Last Modified: 2008-02-01
Due to some requirements, I need to change some users account UID.
I need to know what are the necessary/relevant changes that need to be made once the UIDs are changed. And also how do they related to processes and file permissions and to the applications & DBs running on the systems.

Bottomline is I do not want to change something which I am not aware of the consequences.
0
Comment
Question by:dc-ops
  • 3
4 Comments
 
LVL 10

Accepted Solution

by:
ssvl earned 250 total points
ID: 17945657
you can always check with

find / -uid xxx

where uid is the number of the person whose uid you want to change.  this gives a list of all files owned by that person / user.

if nothing dangerous appears on the list, (apart from the home directory files or one odd files), then you can go ahead and change the uid of the person.

what are the "applications and DBs running" on the system.  i recently saw a script by someone who had given a bash scrip for changing the UID of files owned by a particular person.  but that is secondary.
0
 
LVL 10

Expert Comment

by:ssvl
ID: 17945662
for a change you might want to look at mail, home direcotry files and other things before and after change
0
 
LVL 10

Expert Comment

by:ssvl
ID: 17946049
if  You want to simply change the uid for user  use

# usermod -u <new uid> username
0
 
LVL 34

Expert Comment

by:Duncan Roe
ID: 17950275
Once you change the UID of a regular user, that user will cease to own his home dir and files within. As root you can fix this:-

# usermod -u <new uid> username

# chown -R username: ~username

The colon after username changes the group of the user's files to his default group - miss it out if you're not planning to change that. To make sure you're going to work on the rigt directory, yo can "echo ~username" first - that should echo the path of the user's home dir.

If you are changing the UID of a system user (mailer or whatever), follow the advice posted earlier (find command &c)
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
In my business, I use the LTS (Long Term Support) versions of Linux. My workstations do real work, and so I rarely have the patience to deal with silly problems caused by an upgraded kernel that had experimental software on it to begin with from a r…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question