Solved

change UID for accounts in Linux (Redhat)

Posted on 2006-11-15
4
1,016 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
The purpose of this article is to show how we can create Linux Mint virtual machine using Oracle Virtual Box. To install Linux Mint we have to download the ISO file from its website i.e. http://www.linuxmint.com. Once you open the link you will see …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

760 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now