Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How did you create the new user? If by useradd on the command line, did you set the home directory and default shell?
Did you use passwd to assign the user a password? Is this user able to login locally?
To see what shell is assigned; if you don't have a shell, you cannot log in (via ssh) I guess; but maybe a default shell is chosen; should be visible through /etc/passwd.
In case of no homedirectory, or homedirectory does not exist, it defaults to /; might be cause of the disconnect.
Then again, password logins from ssh may not be allowed and only public/private keys are allowed... so many reasons, so many solutions :-)
Yes, via command line
not given any directory or shell.
useradd kumsuser
Wilthout any options, this will (usually) simply assign a UID to the user - it won't give the user a shell, home directory, or default groups. That's why connecting via ssh fails. Some distributions differ in how they implement useradd.
You can use the "-D" switch with useradd to see the defaults, or set custom values as shown here:
Consider also that ssh may require certain certificates or other information, which are (ordinarily) kept in a hidden .ssh directory in the user's home. This directory, if used, is required to exist and to have specific permissions. Probably your user-add process would not have set up these additional things.
I don't understand what is exactly happened, first one user added successfully with id 500, which i cant login. then i created one more with id 501 that i can login . Then i deleted first one and created the same name with id 502 which is now successfully logged in.
auth.log file not available, in secure.log file below lines printed
Mar 4 06:31:06 EDMS userdel[16734]: delete user 'kumsuser'
Mar 4 06:31:06 EDMS userdel[16734]: removed group 'kumsuser' owned by 'kumsuser'
Mar 4 06:31:28 EDMS useradd[16741]: new group: name=kumsuser, GID=500
Mar 4 06:31:28 EDMS useradd[16741]: new user: name=kumsuser, UID=500, GID=500, home=/home/kumsuser, shell=/bin/bash
Mar 4 06:32:04 EDMS passwd: pam_unix(passwd:chauthtok): password changed for kumsuser
Mar 4 06:33:05 EDMS sshd[16756]: pam_tally2(sshd:auth): user kumsuser (500) tally 19, deny 3
Mar 4 06:33:07 EDMS sshd[16756]: Failed password for kumsuser from 10.50.11.178 port 40959 ssh2
Mar 4 06:33:09 EDMS sshd[16756]: Failed password for kumsuser from 10.50.11.178 port 40959 ssh2
Seems pretty clear that the password is incorrect. Maybe you're using the wrong keyboard layout, and a 'z' is being used instead of a 'y', for example?
The pam_tally2 line in secure.log indicates the account was locked due to too many failed login attempts. It was locked after the 3rd attempt, so even if you entered the correct password after that, it wouldn't let you in until the account is unlocked. The pam_tally2 command is used list the current failed login tallies and to unlock the account.
Same user I deleted and recreated but then also not able to login, then i decided to create one more user now id is 501 and able to login. Now deleted the id 500 user. and created with same user name and id become 502, now able to login with that user name.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.