Can't SSH to remote machine: Connection closed by remote host
Hi Linux users:
I am trying to ssh from a Linux (Mandrake 9.2, 2.4.22-10mdk kernel) machine to another Linux (Mandrake 10.0, 2.6 mdk kernel) box on a remote network. From my machine I can ssh into our linux server on the local network, so I believe my ssh is correctly set up. On the remote machine, PasswordAuthentication is set to be the default "yes". Here's what happens when I try to ssh to the remote computer. Code:
[username@IBMFB1L0DH home]$ ssh <remote_ip> Thanks for any help. --A. |
What's in the logs on the server? It should give a reason.
Check /etc/hosts.allow and /etc/hosts.deny. |
there must be some other reasons besides hosts.allow and hosts.deny. i tried many cofig of those two files (empty and allow all), and it is still the same error.. can somebody solve this? sometimes it is ok, sometimes it is not.. and there's nothing edited in the config files.. why is it like that?
|
It is my understanding that this problem can be caused by too many concurrent connections. If you do a
/etc/init.d/sshd restart does the problem go away again? |
doing /etc/init.d/sshd restart doesn't solve the problem. anyway, i think the problem is that it has too many concurrent connections.
|
Quote:
Code:
/proc/sys/net/core/netdev_max_backlog Code:
/proc/sys/net/core/somaxconn |
This is definitely sshd configuration issue. Restart the sshd and check the /var/log/messages immediately to indentify the problem if any. Check your /etc/ssh/sshd_config
|
Do you have the same user on the remote and local machine?
|
no, the user in local is different from remote. but they are both ordinary users, not root.
|
You need to specify a username like this:
ssh -l <username> <remote ip> or ssh username@remoteip Also if you want to run X apps, use the -X switch: ssh -X -l <username> <remoteip> Hope this helps. |
thanks.. actually im using scp. afaik it user the ssh protocol. and i got the same error msgs. i don't edit mo modify the config but sometimes if fails sometimes it does not.
|
Quote:
if so, what were the original values and what did you increase them to?? |
there's no such file or directory in /proc in remote machine and host machine. what's that for? i don't know things in that level..
|
Quote:
netdev_max_backlog: http://www.google.com/linux?&q=netdev_max_backlog somaxconn: http://www.google.com/linux?&q=somaxconn raising their values has been the solution for people with your same symptoms... |
A basic /etc/ssh/sshd_config should have..
Protocol 2 PasswordAuthentication no UsePAM yes The defaults take care of the rest. Try that and see. This will allow a password based connection. If you have put the client's public key in the server's authorized_keys file, remove it until the password method works ok. Also remove the entry for the server in the clients ~/.ssh/known_hosts file |
All times are GMT -5. The time now is 11:55 PM. |