Kirjoittaja Aihe: ssh: Connection timed out  (Luettu 2082 kertaa)

tetrao

  • Käyttäjä
  • Viestejä: 177
    • Profiili
ssh: Connection timed out
« : 26.10.10 - klo:02.15 »
Mikähän mahtaa olla vialla kun en saa yhteyttä joillekin tiedostopalvelimille komentoriviltä ssh:lla. Tiedostojen siirto scp:llä ei tuota ongelmia. Ssh komentoriviltä toimii hyvin kun ottaa yhteyttä omalle kotipalvelimelle. On tullut kokeiltua googletellakin, mutta eipä tähän ongelmaan ole löytynyt ratkaisua.

/etc/ssh/ssh_config näyttääpi tältä:
Koodia: [Valitse]
#$OpenBSD: ssh_config,v 1.26 2010/01/11 01:39:46 dtucker Exp $

# This is the ssh client system-wide configuration file.  See
# ssh_config(5) for more information.  This file provides defaults for
# users, and the values can be changed in per-user configuration files
# or on the command line.

# Configuration data is parsed as follows:
#  1. command line options
#  2. user-specific file
#  3. system-wide file
# Any configuration value is only changed the first time it is set.
# Thus, host-specific definitions should be at the beginning of the
# configuration file, and defaults at the end.

# Site-wide defaults for some commonly used options.  For a comprehensive
# list of available options, their meanings and defaults, please see the
# ssh_config(5) man page.

Host *
#   ForwardAgent no
#   ForwardX11 no
#   RhostsRSAAuthentication no
#   RSAAuthentication yes
#   PasswordAuthentication yes
#   HostbasedAuthentication no
#   GSSAPIAuthentication no
#   GSSAPIDelegateCredentials no
#   BatchMode no
#   CheckHostIP yes
#   AddressFamily any
#   ConnectTimeout 0
#   StrictHostKeyChecking ask
#   IdentityFile ~/.ssh/identity
#   IdentityFile ~/.ssh/id_rsa
#   IdentityFile ~/.ssh/id_dsa
#    Port 22
#    Protocol 1,2
#   Cipher 3des
#   Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc
#   MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160
#   EscapeChar ~
#   Tunnel no
#   TunnelDevice any:any
#   PermitLocalCommand no
#   VisualHostKey no
#   ProxyCommand ssh -q -W %h:%p gateway.example.com
HashKnownHosts yes
StrictHostKeyChecking ask

Erään ongelmatapauksen /etc/ssh/sshd_config (Tässä tapauksessa käytössä avaimet, kuten myös kotipalvelimella):

Koodia: [Valitse]
# $OpenBSD: sshd_config,v 1.75 2007/03/19 01:01:29 djm Exp $

# This is the sshd server system-wide configuration file.  See
# sshd_config(5) for more information.

# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin

# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented.  Uncommented options change a
# default value.

#Port 22
#Protocol 2,1
ListenAddress 0.0.0.0
#ListenAddress ::

# HostKey for protocol version 1
#HostKey /etc/ssh/sshhostkey
# HostKeys for protocol version 2
#HostKey /etc/ssh/sshhostrsa_key
#HostKey /etc/ssh/sshhostdsa_key

# Lifetime and size of ephemeral version 1 server key
#KeyRegenerationInterval 1h
#ServerKeyBits 768

# Logging
#obsoletes ~QuietMode and ~FascistLogging
#SyslogFacility AUTH
#LogLevel INFO

# Authentication:

#LoginGraceTime 2m
#PermitRootLogin yes
#StrictModes yes
#MaxAuthTries 6

#RSAAuthentication yes
#PubkeyAuthentication yes
#AuthorizedKeysFile     .ssh/authorized_keys

# For this to work you will also need host keys in /etc/ssh/sshknownhosts
#RhostsRSAAuthentication no
# similar for protocol version 2
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# RhostsRSAAuthentication and HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes

# To disable tunneled clear text passwords, change to no here!
PasswordAuthentication no
#PermitEmptyPasswords no

# Change to no to disable s/key passwords
ChallengeResponseAuthentication no

# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes

# 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 mechanism.
# Depending on your PAM configuration, this may bypass the setting of
# PasswordAuthentication, ~PermitEmptyPasswords, and
# "PermitRootLogin without-password". If you just want the PAM account and
# session checks to run without PAM authentication, then enable this but set
# ChallengeResponseAuthentication=no
#UsePAM no

#AllowTcpForwarding yes
#GatewayPorts no
#X11Forwarding no
#X11DisplayOffset 10
#X11UseLocalhost yes
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#UsePrivilegeSeparation yes
#PermitUserEnvironment no
#Compression yes
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS yes
#PidFile /var/run/sshd.pid
#MaxStartups 10

# no default banner path
#Banner /some/path

# override default of no subsystems
Subsystem       sftp    /usr/lib/ssh/sftp-server


Olisiko kenelläkään ideoita? Tuli kokeiltua mm. sekä SSH-1 että 2 protokollia, mutta vaikutusta ei ollut.

« Viimeksi muokattu: 26.10.10 - klo:02.34 kirjoittanut tetrao »
Arch Linux - A simple, lightweight distribution

ditl

  • Vieras
Vs: ssh: Connection timed out
« Vastaus #1 : 26.10.10 - klo:07.12 »

Käytätkö siis julkisella avaimella salattua ssh yhteyttä? Itsellä on toiminut sshd_config 

# Use these options to restrict which interfaces/protocols sshd will bind to
ListenAddress 192.168.11.20 # ei valttamaton, lisasuojaa
Protocol 2
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
#Privilege Separation is turned on for security
UsePrivilegeSeparation yes

# Lifetime and size of ephemeral version 1 server key
KeyRegenerationInterval 3600
ServerKeyBits 768

# Logging
SyslogFacility AUTH
LogLevel INFO

# Authentication:
LoginGraceTime 120
PermitRootLogin yes
StrictModes yes

RSAAuthentication no
PubkeyAuthentication yes
#AuthorizedKeysFile     %h/.ssh/authorized_keys

# 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 no

# 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

UsePAM yes

tetrao

  • Käyttäjä
  • Viestejä: 177
    • Profiili
Vs: ssh: Connection timed out
« Vastaus #2 : 29.10.10 - klo:22.28 »
Lainaus
Käytätkö siis julkisella avaimella salattua ssh yhteyttä? Itsellä on toiminut sshd_config 

Olen testaillut sekä avaimilla, että ilman. Vaikuttaa siltä että vika lienee ssh_config tiedostossa (toisin kuin palvelimen daemonissa), koska esim. putylla yhteyden otto onnistuu. Olisiko sinulla antaa vinkiksi myös se ssh_config? Ajelin ssh:ta verbose moodissa ja ainut mitä sain irti oli tuo connection timed out, joten hankalaksi vetää.
Arch Linux - A simple, lightweight distribution

ditl

  • Vieras
Vs: ssh: Connection timed out
« Vastaus #3 : 30.10.10 - klo:13.11 »
Jos scp toimii mutta ssh ei, on outoa, päällisin puolin katsottuna scp näyttää käyttävän ssh mekanismeja.

Clientin ssh_config toimi oletusarvoilla. Laitan tähän kuitenkin kopion omastani.

Host *
#   ForwardAgent no
#   ForwardX11 no
#   ForwardX11Trusted yes
#   RhostsRSAAuthentication no
#   RSAAuthentication yes
#   PasswordAuthentication yes
#   HostbasedAuthentication no
#   GSSAPIAuthentication no
#   GSSAPIDelegateCredentials no
#   GSSAPIKeyExchange no
#   GSSAPITrustDNS no
#   BatchMode no
#   CheckHostIP yes
#   AddressFamily any
#   ConnectTimeout 0
#   StrictHostKeyChecking ask
#   IdentityFile ~/.ssh/identity
#   IdentityFile ~/.ssh/id_rsa
#   IdentityFile ~/.ssh/id_dsa
#   Port 22
#   Protocol 2,1
#   Cipher 3des
#   Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc
#   MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160
#   EscapeChar ~
#   Tunnel no
#   TunnelDevice any:any
#   PermitLocalCommand no
#   VisualHostKey no
    SendEnv LANG LC_*
    HashKnownHosts yes
    GSSAPIAuthentication yes
    GSSAPIDelegateCredentials no

tetrao

  • Käyttäjä
  • Viestejä: 177
    • Profiili
Vs: ssh: Connection timed out
« Vastaus #4 : 30.10.10 - klo:14.00 »
Noniin, ratkesihan se pulma viimein. Olen näköjään joskus tehnyt aliaksen ssh-yhteydenottoa varten eräälle kiintäelle ip-osoitteelle. Nyt kun ajoin komentoa ssh uusipalvelin, suorittuikin komento: ssh vanhapalvelin uusipalvelin, eli yritettiin otettaa yhteyttä vanhaan palvelimeen joka ei ollut enää käytössä. Tämä selitää miksi scp kuitenkin pelasi ja minkä vuoksi connection timed out. Aliakset ovat kiva apuväline, mutta osaa niistä näköjään olla haittaakin tälläisille huonomuistisille, kuten minä  :D     
Arch Linux - A simple, lightweight distribution