Solved

change UID for accounts in Linux (Redhat)

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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

This document is written for Red Hat Enterprise Linux AS release 4 and ORACLE 10g.  Earlier releases can be installed using this document as well however there are some additional steps for packages to be installed see Metalink. Disclaimer: I hav…
Fine Tune your automatic Updates for Ubuntu / Debian
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

911 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

22 Experts available now in Live!

Get 1:1 Help Now