LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Cannot ssh to Ubuntu box from Windows laptop. (https://www.linuxquestions.org/questions/linux-networking-3/cannot-ssh-to-ubuntu-box-from-windows-laptop-812891/)

oo-ves 06-08-2010 09:58 AM

Cannot ssh to Ubuntu box from Windows laptop.
 
I've just set up OpenSSH on my Ubuntu 8.04 box. Observe no firewall in system services list on ubuntu box. Attempt to ssh using putty from windows laptop attached to same router.

Putty connection times out. Can ping ubuntu box from laptop.

What might I be doing wrong?

Thanks,

Owen.

AlucardZero 06-08-2010 10:01 AM

Are you connecting to the right address?

Is SSHd running on the server?

EricTRA 06-08-2010 10:01 AM

Hello and Welcome to LinuxQuestions,

Did you install the SSH server on your Ubuntu box? Check with this:
Code:

which sshd
and if you installed check with this if it's running:
Code:

ps -ef | grep sshd
If both are true then check if you have it listening:
Code:

netstat -aln | grep ":22"
Kind regards,

Eric

ctkroeker 06-08-2010 10:03 AM

Make sure SSH is running on Ubuntu:
Code:

ps -ae | grep sshd
It should return something like:
Code:

720 ?        00:00:00 sshd

blue_print 06-08-2010 10:09 AM

Please make sure that you have installed openssh-server package in Ubuntu and check whether SSH is running with "ps -ef | grep ssh".

oo-ves 06-09-2010 02:56 AM

Apparently, every thing's fine on Ubuntu box:

Code:

owen@stage-hub:~$ which sshd
/usr/sbin/sshd
owen@stage-hub:~$ ps -ef|grep sshd
root      4820    1  0 17:28 ?        00:00:00 /usr/sbin/sshd
owen      5856  5806  0 17:45 pts/0    00:00:00 grep sshd
owen@stage-hub:~$ netstat -aln|grep ":22"
tcp6      0      0 :::22                  :::*                    LISTEN   
owen@stage-hub:~$

Curiously, I cannot ping Windows laptop from Ubuntu box.

Could this be a firewall problem on my Windows laptop? Could it be a problem with my router?

Thanks,

Owen.

EricTRA 06-09-2010 03:11 AM

Hi,

Can you post your IP configuration of both your Windows and Ubuntu box? Do you have SELinux enabled on Ubuntu? Check with:
Code:

sestatus
Can you ping your router from both boxes?

Kind regards,

Eric

CmdoColin 06-09-2010 04:38 AM

Can't ping the Windows machine... this disturbs me/ The Windows firewalls have honestly caused me a lot of head aches - that's not just a Linux fan boy talking. Might be worth seeing if you can disable this for testing temporarily if it's a safe environment.

Personally I'd want to be able to ping the IP addresses of both devices (and the IP of the router). Might be worth checking the arp table if you are seeing any oddities. Will kinda look like this in a Linux:

Code:

XXXX$ arp -a
? (192.168.1.1) at 00:24:c4:12:34:56 [ether] on eth0
? (192.168.1.2) at 00:50:7f:12:34:56 [ether] on eth0

and this in Windows:

Code:

C:\Users\XXXX>arp -a

Interface: 192.168.1.105 --- 0xb

  Internet Address      Physical Address      Type
  192.168.1.1          00-24-c4-12-34-56    dynamic
  192.168.1.2          00-50-7f-12-34-56    dynamic

I'd be wanting to see everything on the LAN there.

oo-ves 06-10-2010 04:09 AM

Can ping router from Ubuntu.

Hence, believing problem is with Windows laptop, I opened a command line session on my Windows laptop and did what CmdoColin suggested:

Code:

C:\Documents and Settings\Owen Thomas>arp -a

Interface: 192.168.1.64 --- 0x2
  Internet Address      Physical Address      Type
  192.168.1.254        00-1f-9f-d2-84-a0    dynamic

Curiously, the Ubuntu box (192.168.1.67) does not appear.

Believe therefore that remedy lies with Windows config. Although this is a linux discussion group, I would appreciate a fix to this problem.

Thanks,

Owen.

oo-ves 06-10-2010 04:10 AM

Windows XP SP3 I believe.

CmdoColin 06-10-2010 07:17 AM

You were able to ping the Ubuntu machine from your XP machine previously. Try this again, and then check your arp tables again on both machines. If not used / machine is rebooted, they can not be there.

If the mac address again isn't appearing in the arp table then generically check your hardware. Otherwise I'd disable an re-enable the Ethernet port hardware in windows and check the drivers.

Otherwise check the device they connected together with. If it's your internet router; it might be worth checking there is no firewall rules between ports.

oo-ves 06-10-2010 09:27 AM

It might be a trivial note, but the Windows to router is Wireless, Ubuntu to router is Ethernet.

Ubuntu and Windows have been rebooted. Pinged Ubunto and Windows from each to the other as suggested, and retried arp. Running arp reports address of Ubuntu from Windows and vice versa.

Router reports firewall is disabled. This, to me, is still suggestive of a Windows firewall problem.

Hmmm... I disable Windows firewall, and still cannot reach ssh. Very ponderous. I might require some on-site help.

Owen.

SuperJediWombat! 06-10-2010 09:52 AM

Quote:

Originally Posted by oo-ves (Post 3997525)
Apparently, every thing's fine on Ubuntu box:

Code:

owen@stage-hub:~$ netstat -aln|grep ":22"
tcp6      0      0 :::22                  :::*                    LISTEN


sshd is not listening on ipv4.


Please run these commands, and post the output.
Code:

ip route
ifconfig
sudo netstat -tlnp
service ssh status
sudo iptables-save


Thanks,
SuperJediWombat

djsmiley2k 06-10-2010 10:11 AM

Doesn't most OpenSSH packages ship with all the "listening" options disabled by default in the config?

I know for sure that gentoo ships with the

#port 22
#192.168.0.0/24

both commented out for security reasons (Only enable exactly what you need). This means anyone who might of accidently installed openSSH in the past and then had it turned on randomly.

I notice no one else appears to have checked this yet - I'm not sure where the config file is on this distrobution, but I'd reccomend checking the listening options.

SuperJediWombat! 06-10-2010 06:44 PM

Ubuntu should be listening on 0.0.0.0:22 and :::22 by default.
Run this and post the output please:
Code:

grep -v '^#\|^$' /etc/ssh/sshd_config


All times are GMT -5. The time now is 08:16 PM.