LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   User unable to log in via SSH, but only that user (https://www.linuxquestions.org/questions/linux-server-73/user-unable-to-log-in-via-ssh-but-only-that-user-900459/)

theillien 08-31-2011 02:31 PM

User unable to log in via SSH, but only that user
 
I created a VM by copying a gold image that we have. I then created a user for our customer. I set his password and informed him of it. He attempted to log in. The SSH connection was established, but his password is denied. I've deleted and recreated the account, verfied I can log in using my username/password.

The only thing I've seen out of the ordinary is that setting DEBUG in sshd_config displays "unable to open /var/log/btmp: file does not exist" in /var/log/secure.

Anyone have any idea why this would be happening?

T3RM1NVT0R 08-31-2011 03:02 PM

@ Reply
 
Hi there,

Here are few questions and suggestions:

1. Which distribution of linux this is.

2. How did you create his account? Using command line or using gui? If using command line, did you give a try re-creating his account using gui.

3. Only his user account is having problem or couple of other user accounts as well?

4. If you have created the user account using command line. Did you created his home directory? If yes, did you copy everything under /etc/skel to his home directory.

5. Is he having full access on his home directory and is he the owner of the it.

6. Do you see anything in /var/log/messages when he tries to ssh. If yes, please paste the output here.

theillien 08-31-2011 03:16 PM

Quote:

Originally Posted by T3RM1NVT0R (Post 4458226)
Hi there,

Here are few questions and suggestions:

1. Which distribution of linux this is.

RHEL5.5

Quote:

2. How did you create his account? Using command line or using gui? If using command line, did you give a try re-creating his account using gui.
There is no GUI, it's a server. I used useradd to create the account.

Quote:

3. Only his user account is having problem or couple of other user accounts as well?
I tried creating another account and had the same problem. I can't figure out why only my account works.

Quote:

4. If you have created the user account using command line. Did you created his home directory? If yes, did you copy everything under /etc/skel to his home directory.
/etc/skel is copying properly and permissions and ownership are correct.

Quote:

5. Is he having full access on his home directory and is he the owner of the it.
See above.

Quote:

6. Do you see anything in /var/log/messages when he tries to ssh. If yes, please paste the output here.
The only output is that the password failed and the above issue with /var/log/btmp (I touched the file and that log entry went away). The only other thing I noticed is that it verifies the password expiration before prompting so it seems it is reading /etc/shadow properly.

ArcLinux 08-31-2011 03:45 PM

Quote:

Originally Posted by theillien (Post 4458203)
I created a VM by copying a gold image that we have. I then created a user for our customer. I set his password and informed him of it. He attempted to log in. The SSH connection was established, but his password is denied. I've deleted and recreated the account, verfied I can log in using my username/password.

The only thing I've seen out of the ordinary is that setting DEBUG in sshd_config displays "unable to open /var/log/btmp: file does not exist" in /var/log/secure.

Anyone have any idea why this would be happening?

Are you allowing password logins?
Is your account logging in using rsa/dsa passwd?
If so, Is your passwd the same as your rsa/dsa key?

theillien 08-31-2011 03:51 PM

Quote:

Originally Posted by ArcLinux (Post 4458256)
Are you allowing password logins?
Is your account logging in using rsa/dsa passwd?
If so, Is your passwd the same as your rsa/dsa key?

Passwords are in use. I've disabled key authentication and have been able to log in using my password. I even copied the user's public key to the server (making sure permissions were correct), but when he attempts to log in it doesn't bother with that and goes straight to password authentication which then fails.

How do I check if I'm using rsa/dsa?

ArcLinux 08-31-2011 04:05 PM

Quote:

Originally Posted by theillien (Post 4458260)

How do I check if I'm using rsa/dsa?

You will see a prompt that looks something like this:
Enter passphrase for key '/home/<user>/.ssh/id_dsa':


What do these lines in your /etc/ssh/sshd_config look like?

#RSAAuthentication yes
#PubkeyAuthentication yes
.
.
.
#PasswordAuthentication no
#PermitEmptyPasswords no

theillien 08-31-2011 04:07 PM

Those lines don't actually exist. The image was created before I got here and the sshd_config file is quite minimalistic:

Compression yes
UseDNS no
TCPKeepAlive no
ClientAliveCountMax 0
ClientAliveInterval 600
PermitEmptyPasswords no
#PubkeyAuthentication yes
PubkeyAuthentication no
PermitRootLogin no
#PasswordAuthentication yes
Port 22
Protocol 2
ListenAddress 10.153.106.205
Subsystem sftp /usr/libexec/openssh/sftp-server
SyslogFacility AUTHPRIV
UsePrivilegeSeparation yes
X11Forwarding no
Ciphers aes128-ctr,aes192-ctr,aes256-ctr
Ciphers aes128-ctr,aes192-ctr,aes256-ctr
UsePAM yes

T3RM1NVT0R 08-31-2011 07:07 PM

@ Reply
 
Pretty interesting issue. I tried to duplicate this but was not able to exactly duplicate. I succeeded in creating user accounts without having ssh access but with different error messages not with the one which you are getting.

There might be some parameters set in /etc/default/useradd or /etc/login.defs which is resulting in user account creation without ssh access. Chances are also there that a parameter is set in /etc/pam.d/login to prevent ssh login

Paste the output of above mentioned files and lets see what we can come up with.

chrism01 08-31-2011 08:04 PM

Also, can you try ssh -vvv blah .. shows more detail

Reuti 09-01-2011 05:06 AM

Any AllowUsers specified in /etc/ssh/sshd_config which disallow the login for the new user?

theillien 09-01-2011 09:03 AM

No. My sshd_config is posted above. Nothing blocking specific users.

Reuti 09-01-2011 09:30 AM

As you wrote it’s a VM: there are outside ports defined on the real machine which are mapped to the individual virtual machines’s port 22?

theillien 09-01-2011 09:42 AM

SSH is open on the cloud firewall (cloud being what they call it. Personally, I loathe that word for this technology). I've created VMs using other images that don't have this problem.

T3RM1NVT0R 09-01-2011 01:58 PM

@ Reply
 
@ theillien

Did you check the files which I mentioned before.

@ Reuti

Does not appear to be firewall/ports issue the reason being one user is able to login. I can think of tcp wrappers but I am guessing that he is using the same machine to ssh this machine using his account and problematic user account. So tcp wrappers will not come in picture.

theillien 09-01-2011 02:05 PM

I have not had an opportunity yet. I'll post them as soon as I'm able.


All times are GMT -5. The time now is 10:22 AM.