LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-04-2016, 01:30 AM   #1
Kumaresanpvk77
LQ Newbie
 
Registered: Nov 2015
Posts: 10

Rep: Reputation: Disabled
New User added, bot not able to login via SSH


Hi All,

I have added new user successfully. but not able to login.
Permission denied, please try again.

Can anyone pls help on this.

Kumaresan P
 
Old 03-04-2016, 01:58 AM   #2
OregonJim
Member
 
Registered: Feb 2016
Posts: 98

Rep: Reputation: Disabled
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?
 
Old 03-04-2016, 03:01 AM   #3
Kumaresanpvk77
LQ Newbie
 
Registered: Nov 2015
Posts: 10

Original Poster
Rep: Reputation: Disabled
Yes, via command line
not given any directory or shell.

useradd kumsuser
passwd kumsuser

su kumsuser (happening from root)

But not new connection
 
Old 03-04-2016, 05:22 AM   #4
fmattheus
Member
 
Registered: Nov 2015
Posts: 104

Rep: Reputation: 38
Anything showing up in the log files?
 
Old 03-04-2016, 05:28 AM   #5
dijetlo
Senior Member
 
Registered: Jan 2009
Location: RHELtopia....
Distribution: Solaris 11.2/Slackware/RHEL/
Posts: 1,491
Blog Entries: 2

Rep: Reputation: Disabled
not given any directory or shell.

I think if you assigned your user a home (login) directory you'd probably be able to ssh into the instance using the local users credentials.
 
Old 03-04-2016, 07:32 AM   #6
Ramurd
Member
 
Registered: Mar 2009
Location: Rotterdam, the Netherlands
Distribution: Slackwarelinux
Posts: 703

Rep: Reputation: 111Reputation: 111
Code:
grep kumsuser /etc/passwd
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 :-)
 
Old 03-04-2016, 11:59 AM   #7
OregonJim
Member
 
Registered: Feb 2016
Posts: 98

Rep: Reputation: Disabled
Quote:
Originally Posted by Kumaresanpvk77 View Post
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:

http://www.computerhope.com/unix/useradd.htm

Last edited by OregonJim; 03-04-2016 at 12:05 PM.
 
Old 03-04-2016, 12:03 PM   #8
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,927

Rep: Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320
or use adduser instead of useradd
 
Old 03-06-2016, 07:56 AM   #9
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,671
Blog Entries: 4

Rep: Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945
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.
 
Old 03-07-2016, 11:24 PM   #10
Kumaresanpvk77
LQ Newbie
 
Registered: Nov 2015
Posts: 10

Original Poster
Rep: Reputation: Disabled
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.

Can anyone explain..?
 
Old 03-08-2016, 02:01 AM   #11
fmattheus
Member
 
Registered: Nov 2015
Posts: 104

Rep: Reputation: 38
Going back to my post from 4 days ago ...
Quote:
Originally Posted by fmattheus View Post
Anything showing up in the log files?
Specifically in the /var/log/auth.log at the time of a login attempt.
 
Old 03-09-2016, 12:57 AM   #12
Kumaresanpvk77
LQ Newbie
 
Registered: Nov 2015
Posts: 10

Original Poster
Rep: Reputation: Disabled
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
 
Old 03-09-2016, 02:12 AM   #13
fmattheus
Member
 
Registered: Nov 2015
Posts: 104

Rep: Reputation: 38
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?
 
Old 03-09-2016, 08:20 AM   #14
sgrlscz
Member
 
Registered: Aug 2008
Posts: 123

Rep: Reputation: 84
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.
 
Old 03-09-2016, 11:30 PM   #15
Kumaresanpvk77
LQ Newbie
 
Registered: Nov 2015
Posts: 10

Original Poster
Rep: Reputation: Disabled
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Added New User nothing works under new login JimmyTheSaint23 Ubuntu 6 03-23-2007 03:36 PM
SSH - cannot login as 1 particular user pnellesen Linux - Networking 7 11-24-2006 11:25 PM
Added new user not available for login anatman SUSE / openSUSE 2 05-23-2006 04:05 PM
NIS prob: added user to server, but can't login to client BrianK Linux - General 3 10-06-2004 04:29 PM
HELP me on SSH User login manya Linux - Security 1 05-03-2004 03:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration