PDA

View Full Version : [ubuntu] Ssh is not working on two machine



sbhavra
September 9th, 2011, 09:28 AM
Hi,

I am having two machines having ubuntu installed on it. currently i an not able to connect the machines via ssh and getting connection refused message while connecting to the another machine.

I have checked the firewall is enabled. ssh is also installed. When i do the ssh to machine itself it is working. But not for accessing the different machine.

Due to this issue i am not able to connect to Mysql server from another machine having mysql client installed on it.

Please suggest.

Regards,
Suukhbir

Grenage
September 9th, 2011, 09:31 AM
You are 100% sure that openssh-server is installed? (on the machines you are connecting to)

sbhavra
September 9th, 2011, 09:51 AM
yup i have checked it. it is installed.

Because when i ssh@machineitself to itself it is working.

Grenage
September 9th, 2011, 10:35 AM
Interesting; especially if you're not using a firewall. Are you connecting to the machines by IP or DNS name?

sbhavra
September 9th, 2011, 10:39 AM
I am using the ip address like
ssh root@172.xx.xx.xxy.

Wayne_V
September 9th, 2011, 10:41 AM
first, I would install nmap and make sure the ssh ports are showing open on the other computer.

then, stop the ssh server and run it in a terminal in debug mode:

$ sudo /etc/init.d/ssh stop
$ sudo /usr/sbin/sshd -vvv

now, when you connect from the other system, if there is a config error it should be obvious in the debug output.

Wayne_V
September 9th, 2011, 10:44 AM
I am using the ip address like
ssh root@172.xx.xx.xxy.

also, with Ubuntu desktop at least (not sure about server), login as root is disabled by default.

https://help.ubuntu.com/community/RootSudo

Grenage
September 9th, 2011, 10:51 AM
I am using the ip address like
ssh root@172.xx.xx.xxy.

Ok, well in my experience this is usually down to one of three things:

1) ssh-server is not installed
2) sshd is not running
3) firewall

1 and 2 and unlikely in this situation.

Are you positive that you don't have a firewall rule blocking this, either on the server or a device between the client and server?

Vishal Agarwal
September 9th, 2011, 12:16 PM
open the ssh port in firewall. I feel that will be creating problem. Just now i have faced the same problem in one of my local PC.

sbhavra
September 9th, 2011, 12:19 PM
This port is already open in the firewall.

Vishal Agarwal
September 9th, 2011, 12:27 PM
Ok check the opened ports using nmap x.x.x.x
it will show you the opened ports
after that do telnet x.x.x.x
if it telnet then let me know; wil check some other process

Do the same exercise on both of the computers