Created New user in Linux, but not able to login in putty or SSH or else
8,449
Solution 1
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.
Solution 2
/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.
Author by
Kumar
Updated on September 18, 2022Comments
-
Kumar over 1 year
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
-
Jason Sherman about 11 yearsIs 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.
-
dashboard about 11 yearsrun sudo passwd in your terminal
-
YankeeWhiskey about 11 yearsAre 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.
-
slackmart about 11 yearsIf 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.
-
max about 11 yearsWhile login are you getting any error? is bash really in
/usr/local/bin
? or in/bin/bash
? add a user like thisuseradd
sampleuser thenpasswd
and try to login.
-