Red Hat: Error connecting using secure shell

Hi All,

I am getting below error when I try to connect with ssh. Not sure why the error is on.I am able to connect from a different login from the same server

(local: rhe/home/s3>) ssh  acces1@91.1.12.102
Connection closed by  91.1.12.102
(local: rhe/home/s3>)  ssh redhlinx102
Connection closed by   91.1.12.102

Below is what I am getting in debug mode

Great. Look at the home and .ssh directories permissions (and acl's if any ) on the account that works - both local and remote. Make the one that fails match permissions exactly to the good account. Do that for key files as well. Keyfiles have to match ownership with the owner of the home directory.

This is the most common way to get and fix the result you see. There are lots of other ways things can get broken, but this will get you started. Next step is setting correct key files with correct permissions on key files in the .ssh directory for the bad account. Both servers. Remember, to login from a remote node the place that gets logged into has to have the correct keys from the incoming site in the user's .ssh directory.

See if that will get you going. If not, check back here.

I compared all the permission with home and ssh directory all are same. I tried to do on a different server . I got below error. Not sure why on the other machine I am getting connection refused. It should show ask for password atleast.

(prod: rhe/home/ps3>)  ssh redhlinx102
ps3@redhlinx102's password:

On the remote box:
is there an entry in sshd_config: UsePAM yes If so,
Then is there an entry for the user that cannot connect? in /etc/security/access.conf
This typically disables local logins but with ssh it will disable network as well, I believe.

It looks like net login is disabled for that particular user. I do not know how that would have been setup based on what you said so far.

When you are already logged into the remote box with an account that works, can you use either su - baduser or do a console connect and login (not a network login)?
The user may not even be able to login locally.

1 Like

Yes I am able to login with the user id to remote machine . Also only this user that is getting me

I tried to do ssh with dummy users it prompted me for password

ssh acces1@91.1.12.102
Connection closed by 91.1.12.102

ssh test@91.1.12.102
test@91.1.12.102's password:


ssh ttt@91.1.12.102
ttt@91.1.12.102's password:

I just looked and find when I type users in the remote machine I am not able to find the one user I am looking . will that be a reason ?. However I am able to sudo to the user

---------- Post updated at 07:38 AM ---------- Previous update was at 12:38 AM ----------

Other things noted:

When I changed the authorized_keys to chmod 777 the ssh prompted me to enter the password. When I make it as chmod 700 ssh showed below error

If you are using keys, the permissions for the remote account should be as follows:

$HOME directory should not be writable by others
.ssh should be 700
authorized_keys should be 600

Thanks. I made the permissions as mentioned and I got the below error

Found the problem. THe designation server has no password set on etc/passwd file . After setting that it worked.

Thanks for all help