Why login with user created with useradd command in Debian has no enviroment set? [closed]

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I started to learn linux and I came a cross problem I would like to ask. After I use useradd command in debian, I get new user with home directory. I check that directories from /etc/skel are copied and everything seems fine. But when I log to user with su - user I get only $ sign and I see that PS1 variable is not set, colours and other things. User created with adduser doesn't have this problem and If I check difference between .bashrc and .profile files for both users, there are the same. So why is this happening?







share|improve this question














closed as off-topic by Jeff Schaller, G-Man, Satō Katsura, Rui F Ribeiro, GAD3R Feb 17 at 17:21


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – Jeff Schaller, G-Man, Satō Katsura, Rui F Ribeiro, GAD3R
If this question can be reworded to fit the rules in the help center, please edit the question.








  • 2




    Are you certain that you used the hyphen in the su - user ?
    – Jeff Schaller
    Feb 16 at 20:05






  • 1




    Relating: unix.stackexchange.com/q/121071/117549
    – Jeff Schaller
    Feb 16 at 20:06






  • 1




    Which login shell was assigned to the user?
    – steeldriver
    Feb 16 at 20:19














up vote
0
down vote

favorite












I started to learn linux and I came a cross problem I would like to ask. After I use useradd command in debian, I get new user with home directory. I check that directories from /etc/skel are copied and everything seems fine. But when I log to user with su - user I get only $ sign and I see that PS1 variable is not set, colours and other things. User created with adduser doesn't have this problem and If I check difference between .bashrc and .profile files for both users, there are the same. So why is this happening?







share|improve this question














closed as off-topic by Jeff Schaller, G-Man, Satō Katsura, Rui F Ribeiro, GAD3R Feb 17 at 17:21


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – Jeff Schaller, G-Man, Satō Katsura, Rui F Ribeiro, GAD3R
If this question can be reworded to fit the rules in the help center, please edit the question.








  • 2




    Are you certain that you used the hyphen in the su - user ?
    – Jeff Schaller
    Feb 16 at 20:05






  • 1




    Relating: unix.stackexchange.com/q/121071/117549
    – Jeff Schaller
    Feb 16 at 20:06






  • 1




    Which login shell was assigned to the user?
    – steeldriver
    Feb 16 at 20:19












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I started to learn linux and I came a cross problem I would like to ask. After I use useradd command in debian, I get new user with home directory. I check that directories from /etc/skel are copied and everything seems fine. But when I log to user with su - user I get only $ sign and I see that PS1 variable is not set, colours and other things. User created with adduser doesn't have this problem and If I check difference between .bashrc and .profile files for both users, there are the same. So why is this happening?







share|improve this question














I started to learn linux and I came a cross problem I would like to ask. After I use useradd command in debian, I get new user with home directory. I check that directories from /etc/skel are copied and everything seems fine. But when I log to user with su - user I get only $ sign and I see that PS1 variable is not set, colours and other things. User created with adduser doesn't have this problem and If I check difference between .bashrc and .profile files for both users, there are the same. So why is this happening?









share|improve this question













share|improve this question




share|improve this question








edited Feb 16 at 20:03









Jeff Schaller

31.2k846105




31.2k846105










asked Feb 16 at 19:57









user276387

1




1




closed as off-topic by Jeff Schaller, G-Man, Satō Katsura, Rui F Ribeiro, GAD3R Feb 17 at 17:21


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – Jeff Schaller, G-Man, Satō Katsura, Rui F Ribeiro, GAD3R
If this question can be reworded to fit the rules in the help center, please edit the question.




closed as off-topic by Jeff Schaller, G-Man, Satō Katsura, Rui F Ribeiro, GAD3R Feb 17 at 17:21


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – Jeff Schaller, G-Man, Satō Katsura, Rui F Ribeiro, GAD3R
If this question can be reworded to fit the rules in the help center, please edit the question.







  • 2




    Are you certain that you used the hyphen in the su - user ?
    – Jeff Schaller
    Feb 16 at 20:05






  • 1




    Relating: unix.stackexchange.com/q/121071/117549
    – Jeff Schaller
    Feb 16 at 20:06






  • 1




    Which login shell was assigned to the user?
    – steeldriver
    Feb 16 at 20:19












  • 2




    Are you certain that you used the hyphen in the su - user ?
    – Jeff Schaller
    Feb 16 at 20:05






  • 1




    Relating: unix.stackexchange.com/q/121071/117549
    – Jeff Schaller
    Feb 16 at 20:06






  • 1




    Which login shell was assigned to the user?
    – steeldriver
    Feb 16 at 20:19







2




2




Are you certain that you used the hyphen in the su - user ?
– Jeff Schaller
Feb 16 at 20:05




Are you certain that you used the hyphen in the su - user ?
– Jeff Schaller
Feb 16 at 20:05




1




1




Relating: unix.stackexchange.com/q/121071/117549
– Jeff Schaller
Feb 16 at 20:06




Relating: unix.stackexchange.com/q/121071/117549
– Jeff Schaller
Feb 16 at 20:06




1




1




Which login shell was assigned to the user?
– steeldriver
Feb 16 at 20:19




Which login shell was assigned to the user?
– steeldriver
Feb 16 at 20:19










1 Answer
1






active

oldest

votes

















up vote
5
down vote













When you use useradd you have to specify all sorts of stuff - default shell, home directory, etc. If you aren't seeing a normal bash prompt, I would assume that you didn't specify /bin/bash as the user's shell and it defaulted to /bin/sh or similar.



To be honest, useradd is great for when you are adding users programmatically via a script. Not so great for one-off adding a single user.



Much better to instead use adduser newusername ....






share|improve this answer




















  • adduser is good for scripted user creation too - just remember to use --disabled-password so it doesn't prompt for a password. You can set the password later with echo user:pass | chpasswd.
    – cas
    Feb 17 at 0:23

















1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
5
down vote













When you use useradd you have to specify all sorts of stuff - default shell, home directory, etc. If you aren't seeing a normal bash prompt, I would assume that you didn't specify /bin/bash as the user's shell and it defaulted to /bin/sh or similar.



To be honest, useradd is great for when you are adding users programmatically via a script. Not so great for one-off adding a single user.



Much better to instead use adduser newusername ....






share|improve this answer




















  • adduser is good for scripted user creation too - just remember to use --disabled-password so it doesn't prompt for a password. You can set the password later with echo user:pass | chpasswd.
    – cas
    Feb 17 at 0:23














up vote
5
down vote













When you use useradd you have to specify all sorts of stuff - default shell, home directory, etc. If you aren't seeing a normal bash prompt, I would assume that you didn't specify /bin/bash as the user's shell and it defaulted to /bin/sh or similar.



To be honest, useradd is great for when you are adding users programmatically via a script. Not so great for one-off adding a single user.



Much better to instead use adduser newusername ....






share|improve this answer




















  • adduser is good for scripted user creation too - just remember to use --disabled-password so it doesn't prompt for a password. You can set the password later with echo user:pass | chpasswd.
    – cas
    Feb 17 at 0:23












up vote
5
down vote










up vote
5
down vote









When you use useradd you have to specify all sorts of stuff - default shell, home directory, etc. If you aren't seeing a normal bash prompt, I would assume that you didn't specify /bin/bash as the user's shell and it defaulted to /bin/sh or similar.



To be honest, useradd is great for when you are adding users programmatically via a script. Not so great for one-off adding a single user.



Much better to instead use adduser newusername ....






share|improve this answer












When you use useradd you have to specify all sorts of stuff - default shell, home directory, etc. If you aren't seeing a normal bash prompt, I would assume that you didn't specify /bin/bash as the user's shell and it defaulted to /bin/sh or similar.



To be honest, useradd is great for when you are adding users programmatically via a script. Not so great for one-off adding a single user.



Much better to instead use adduser newusername ....







share|improve this answer












share|improve this answer



share|improve this answer










answered Feb 16 at 20:56









ivanivan

3,1271213




3,1271213











  • adduser is good for scripted user creation too - just remember to use --disabled-password so it doesn't prompt for a password. You can set the password later with echo user:pass | chpasswd.
    – cas
    Feb 17 at 0:23
















  • adduser is good for scripted user creation too - just remember to use --disabled-password so it doesn't prompt for a password. You can set the password later with echo user:pass | chpasswd.
    – cas
    Feb 17 at 0:23















adduser is good for scripted user creation too - just remember to use --disabled-password so it doesn't prompt for a password. You can set the password later with echo user:pass | chpasswd.
– cas
Feb 17 at 0:23




adduser is good for scripted user creation too - just remember to use --disabled-password so it doesn't prompt for a password. You can set the password later with echo user:pass | chpasswd.
– cas
Feb 17 at 0:23


Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay