[SOLVED] problem with ssh/putty. Error: "connection timed out"
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
problem with ssh/putty. Error: "connection timed out"
I'm trying to ssh from my windows machine using putty into a Linux VM for my certification studies. This is password based authentication, so i'm not using any pub/private keys. Not entirely concerned about that right - I just want things to work first then i'll get to that.
I'm running a relatively new install of mint, and the sshd daemon already up and running. I'm able to ssh to the guest localhost within the VM, but I can't ssh into the VM externally from host (windows). I disabled ufw to see if that would be the culprit but the problem persists.
here's my sshd_config file.
Quote:
# Package generated configuration file
# See the sshd_config(5) manpage for details
# What ports, IPs and protocols we listen for
Port 22
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
#ListenAddress 0.0.0.0
Protocol 2
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
#Privilege Separation is turned on for security
UsePrivilegeSeparation yes
# Lifetime and size of ephemeral version 1 server key
KeyRegenerationInterval 3600
ServerKeyBits 768
# Don't read the user's ~/.rhosts and ~/.shosts files
IgnoreRhosts yes
# For this to work you will also need host keys in /etc/ssh_known_hosts
RhostsRSAAuthentication no
# similar for protocol version 2
HostbasedAuthentication no
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
#IgnoreUserKnownHosts yes
# To enable empty passwords, change to yes (NOT RECOMMENDED)
PermitEmptyPasswords no
# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no
# Change to no to disable tunnelled clear text passwords
#PasswordAuthentication yes
# Kerberos options
#KerberosAuthentication no
#KerberosGetAFSToken no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes
X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
#UseLogin no
#MaxStartups 10:30:60
#Banner /etc/issue.net
# Allow client to pass locale environment variables
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server
# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication. Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
UsePAM yes
Could it be that NAT/router is somehow blocking port 22 for ssh traffic?
If there is any misconfiguration in sshd_config or anywhere else, i'd appreciate any feedback. thanks
Yes it could, if by 'external' you mean the other side of a router. I would check that your port forwarding is functioning and also double check that the firewall is correctly allowing port 22 through.
Yes it could, if by 'external' you mean the other side of a router. I would check that your port forwarding is functioning and also double check that the firewall is correctly allowing port 22 through.
Yeah the other side of the router. By firewall - you mean the windows firewall, correct? I'll look into my port forwarding.
After you add them at the end of sshd_config, restart sshd server and try again.
It still gives me that same error. Can anyone me tell what I should do with my router? I have a feeling that's the issue. I even tried adding a new inbound and outbound rule for the W7 firewall to allow port 22 for ssh traffic, and the problem is still there. i'm a total noob with networking.
edit: I have fixed the issue! The virtual box network settings for my VM were configured the wrong way. Under "Network" within the settings option in VirtualBox, the "attached to:" option was set to "NAT", and apparently under this configuration you aren't to able connect to any of the services within the virtual machine. So I switched the option to "Bridged Adapter" instead and selected "Allow VMs" under promiscuous mode. This also changed the local IP on the VM to another one that's on the same subnet as my Windows host machine. So now I'm able to SSH into my VM using PuTTY and access the internet from within the VM.
After you add them at the end of sshd_config, restart sshd server and try again.
I think you should re check the error which was posted by OP and I believe these options which you have provided have nothing to do with the error. These are used when a client gets disconnected due to idle putty session.
It still gives me that same error. Can anyone me tell what I should do with my router? I have a feeling that's the issue. I even tried adding a new inbound and outbound rule for the W7 firewall to allow port 22 for ssh traffic, and the problem is still there. i'm a total noob with networking.
edit: I have fixed the issue! The virtual box network settings for my VM were configured the wrong way. Under "Network" within the settings option in VirtualBox, the "attached to:" option was set to "NAT", and apparently under this configuration you aren't to able connect to any of the services within the virtual machine. So I switched the option to "Bridged Adapter" instead and selected "Allow VMs" under promiscuous mode. This also changed the local IP on the VM to another one that's on the same subnet as my Windows host machine. So now I'm able to SSH into my VM using PuTTY and access the internet from within the VM.
Late but thought I will update since I just experienced this issue. My two Oracle Linux servers were not started for some time in Oracle VM so when I started them the network adapter was missing. I created the network adapter and had the issue described in this post. How is fixed it was when a new Host-Only network adapter is created I forgot to assign the same ip4v address as I had to the network adapter when I created it. Once the network adapter ip4v was set to its previous value and DHCP was enabled all was good.
I enabled DHCP because thats I how it was, hope this helps anyone else
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.