Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am new to Linux, I don't know in-depth things. I created a user from the root account, but I am not able to login as the new user (sampleUser). Here are the commands I used to create new user:

useradd  -m  -s  /usr/local/bin/bash  -d  /home/sampleuser   sampleuser
passwd sampleuser  
chown sampleuser.sampleuser sampleuser
chmod 777 sampleuser
share|improve this question

closed as too localized by random Apr 6 '13 at 18:08

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

1  
Is bash really in /usr/local/bin? Not that it can't be, but that's a little unusual. If the shell isn't there, that could prevent login. –  Jason Sherman Apr 6 '13 at 2:08
1  
run sudo passwd in your terminal –  dashboard Apr 6 '13 at 2:12
1  
Are you able to ssh into it using your original login? Because in a lot of distros, ssh server is off by default and you have to manually bring it up. –  YankeeWhiskey Apr 6 '13 at 2:30
    
If you aren't a super linux user, you can use shadow package, which provide an interactive command to create new users. The command is adduser and can configure your new user. –  sgmart Apr 6 '13 at 3:51
    
While login are you getting any error? is bash really in /usr/local/bin ? or in /bin/bash ? add a user like this useradd sampleuser then passwdand try to login. –  max Apr 6 '13 at 4:43

2 Answers 2

as root user, edit /etc/ssh/sshd_conf and see if you have lines starting with AllowUsers or DenyUsers keywords. If you do, add the new user name to the end of one of the AllowUsers lines.

share|improve this answer

/usr/local/bin/bash is a remarkable place for a login shell but possible. Make sure it is there and make sure it is listed in /etc/shells. PAM or SSH might require this.

777 permissions on a home directory of a user with a login shell is not safe and could also be checked for valid logins by PAM for instance.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.