LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   when i open new users terminal it starts in old users home (https://www.linuxquestions.org/questions/linux-newbie-8/when-i-open-new-users-terminal-it-starts-in-old-users-home-899129/)

event2000 08-24-2011 04:58 AM

when i open new users terminal it starts in old users home
 
Hi

I added a new user. But if I start a terminal session on gnome or file browser or something it always starts in the home directory of another user.

If i do "cd" it jumps back to the home dir correctly.

Any ideas?

tronayne 08-24-2011 08:32 AM

Take a look at /etc/passwd -- you've (possibly) re-used the UID (that's the number, not the name).

The fields in /etc/passwd are
  1. login name
  2. optional encrypted password
  3. numerical user ID
  4. numerical group ID
  5. user name or comment field
  6. user home directory
  7. optional user command interpreter
You're looking for two lines with the same numerical user ID (UID) or the same user home directory. They'll be at the end of the file.

Note that your system uses shadow passwords -- there should only be an x in the optional encrypted password field (and don't monkey with it!).

If you do have duplicate entries (as above), you'll need to use the usermod utility to fix the one you just added (leave the old one alone); the "fix" is to change the UID to one that is not used. Most systems start UIDs at 1000 and go up by one for each additional user, so if the duplicate is, say, 1010 and there is not 1011, simply change the new UID to 1011. The user accounts are found at the bottom of /etc/passwd.

Note that you can, if you're careful, manually edit /etc/passwd as root or with sudo. Make a backup copy first, then edit (carefully!) with your favorite text editor.

Also note that if the problem is a duplicate UID and you change the new user UID you will need to run
Code:

chown -R username /home/username
Hope this helps some.

event2000 08-24-2011 01:10 PM

Ok I will try this, thanks alot!


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