LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Trouble logging in as another user (https://www.linuxquestions.org/questions/linux-newbie-8/trouble-logging-in-as-another-user-593804/)

ForJazz 10-22-2007 07:22 PM

Trouble logging in as another user
 
Warning: major newbie

I am taking a class in Linux and we are kind of winging it, so I could really use some help.

I am trying to practice adding users, creating files, and all of the other basic things. I am using Ubuntu Linux - Feisty Fawn. To add a user I logged in as root, added her with a home directory, and gave her a password. My problem is when I try to log in as her. I have tried using login <user> as well as su <user>, but neither of them lists the full location of the user when I do this. All I get is this:

$

The prompt is there, and it seems I am able to do things, but then when I do things like make a file, (vi <file>) the file doesn't seem to save right, and funny things like that. Can someone tell me if I am missing something?

I_like_TUX 10-22-2007 08:15 PM

I do not use Ubuntu but I believe user management should be similar on all *nix systems. Anyway, please post what commands you used to create the user. When you get the "$" prompt after logging in as that user, please do the following and post the results:
$ pwd
$ ls -a
$ env | grep HOME
$ echo $PS1
Also, I think you should use "su - <userid>" instead of just "su <userid>". I believe "su - <userid>" make sure the shell inherit all the environment variables of the new user. Might be someone with more knowledge confirm this. Thanks.

miajah 10-22-2007 09:42 PM

thanks!
 
Quote:

Originally Posted by I_like_TUX (Post 2933180)
I do not use Ubuntu but I believe user management should be similar on all *nix systems. Anyway, please post what commands you used to create the user. When you get the "$" prompt after logging in as that user, please do the following and post the results:
$ pwd
$ ls -a
$ env | grep HOME
$ echo $PS1
Also, I think you should use "su - <userid>" instead of just "su <userid>". I believe "su - <userid>" make sure the shell inherit all the environment variables of the new user. Might be someone with more knowledge confirm this. Thanks.

I have the same question! I think this is Nice answer, I'll try this
thanks for sharing!

ForJazz 10-28-2007 02:26 PM

I did useradd -m molly, then passwd molly. I tried login molly and then su molly - I'll try adding the dash.

I_like_TUX 10-28-2007 08:41 PM

Quote:

Originally Posted by ForJazz (Post 2940039)
I did useradd -m molly, then passwd molly. I tried login molly and then su molly - I'll try adding the dash.

If su - does not work, please post the results of the commands I suggested in the previous post.


All times are GMT -5. The time now is 07:36 PM.