PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : SSH per KEY failed - merkwürdige Portangabe



rootforlife
18.10.04, 10:23
Hallo,

ich verzweifle schon seit 2 Tagen daran, dass ich nicht einem Schlüssel auf meinen Server komme (Alturo mit Suse). Der Schlüssel wird richtig sein, da sonst eine andere Fehlermeldung kam.

Hier ein Auszug aus dem Log. Merkwürdig finde ich die Zeile

Failed none for cvsfoo from ::ffff:217.251.XX.XX port 3659 ssh2

Die Portangabe ist in den Logs bei Euch nicht vorhanden. Zuhause sitze ich in einem Netzwerk. Liegt es daran?

Viele Grüße

Lars
-------------------------------------

Oct 18 10:59:29 a1516XXXX sshd[24581]: Connection from ::ffff:217.251.XX.XX port 3659
Oct 18 10:59:29 a1516XXXX sshd[24569]: debug1: Forked child 24581.
Oct 18 10:59:33 a1516XXXX sshd[24581]: debug1: Client protocol version 2.0; client software version PuTTY-Release-0.55
Oct 18 10:59:33 a1516XXXX sshd[24581]: debug1: no match: PuTTY-Release-0.55
Oct 18 10:59:33 a1516XXXX sshd[24581]: debug1: Enabling compatibility mode for protocol 2.0
Oct 18 10:59:33 a1516XXXX sshd[24581]: debug1: Local version string SSH-2.0-OpenSSH_3.8p1
Oct 18 10:59:34 a1516XXXX sshd[24581]: debug1: PAM: initializing for "cvsfoo"
Oct 18 10:59:34 a1516XXXX sshd[24581]: debug1: PAM: setting PAM_RHOST to "pd9fb3fe3.dip.t-dialin.net"
Oct 18 10:59:34 a1516XXXX sshd[24581]: debug1: PAM: setting PAM_TTY to "ssh"
Oct 18 10:59:34 a1516XXXX sshd[24581]: Failed none for cvsfoo from ::ffff:217.251.XX.XXX port 3659 ssh2
Oct 18 10:59:35 a1516XXXX sshd[24581]: debug1: temporarily_use_uid: 1001/1000 (e=0/0)
Oct 18 10:59:35 a1516XXXX sshd[24581]: debug1: trying public key file /home/cvsfoo/.ssh/authorized_keys2
Oct 18 10:59:35 a1516XXXX sshd[24581]: debug1: restore_uid: 0/0
Oct 18 10:59:35 a1516XXXX sshd[24581]: debug1: temporarily_use_uid: 1001/1000 (e=0/0)
Oct 18 10:59:35 a1516XXXX sshd[24581]: debug1: trying public key file /home/cvsfoo/.ssh/authorized_keys2
Oct 18 10:59:35 a1516XXXX sshd[24581]: debug1: restore_uid: 0/0
Oct 18 10:59:40 a1516XXXX sshd[24581]: debug1: do_cleanup
Oct 18 10:59:40 a1516XXXX sshd[24581]: debug1: PAM: cleanup

----------------------------------------

Terran Marine
18.10.04, 18:23
Failed none for cvsfoo from ::ffff:217.251.XX.XX port 3659 ssh2

Die Portangabe ist in den Logs bei Euch nicht vorhanden. Zuhause sitze ich in einem Netzwerk. Liegt es daran?


Ich kann mich irren, aber ist das nicht einfach nur der Source-Port der TCP-Connection ?

Gruß
Terran

Blade
18.10.04, 19:01
Willst Du eine ssh-Verbindung ohne Passwort herstellen?
Hast Du mal die ältere putty-Version 0.54 getestet?

rootforlife
18.10.04, 19:48
Hallo,

ja möchte mich mit Key anmelden ohne Kennwort. Habe jetzt mal die 0.54 Version von Putty probiert: negativ.

Hier das Putty-Log:

2004-10-18 20:44:44 Looking up host "217.160.XXX.XX"
2004-10-18 20:44:44 Connecting to 217.160.XXX.XX port 22
2004-10-18 20:44:45 Writing new session log (raw mode) to file: C:\sshkeys\0\putty.log
2004-10-18 20:44:45 Server version: SSH-2.0-OpenSSH_3.8p1
2004-10-18 20:44:45 We claim version: SSH-2.0-PuTTY-Release-0.54
2004-10-18 20:44:45 Using SSH protocol version 2
2004-10-18 20:44:45 Doing Diffie-Hellman group exchange
2004-10-18 20:44:45 Doing Diffie-Hellman key exchange
2004-10-18 20:44:46 Host key fingerprint is:
2004-10-18 20:44:46 ssh-rsa 1024 57:c6:13:6b:f5:31:12:99:ee:55:27:ce:9c:58:d1:19
2004-10-18 20:44:46 Initialised AES-256 client->server encryption
2004-10-18 20:44:46 Initialised AES-256 server->client encryption
2004-10-18 20:44:46 Reading private key file "C:\sshkeys\neu\private.ppk"
2004-10-18 20:44:46 Pageant is running. Requesting keys.
2004-10-18 20:44:46 Pageant has 1 SSH2 keys
2004-10-18 20:44:46 Trying Pageant key #0
2004-10-18 20:44:46 This key matches configured key file
2004-10-18 20:44:46 Key refused
2004-10-18 20:44:46 Keyboard-interactive authentication refused

Blade
18.10.04, 19:58
2004-10-18 20:44:46 Initialised AES-256 client->server encryption
2004-10-18 20:44:46 Initialised AES-256 server->client encryption
2004-10-18 20:44:46 Reading private key file "C:\sshkeys\neu\private.ppk"
2004-10-18 20:44:46 Pageant is running. Requesting keys.
2004-10-18 20:44:46 Pageant has 1 SSH2 keys
2004-10-18 20:44:46 Trying Pageant key #0
2004-10-18 20:44:46 This key matches configured key file
2004-10-18 20:44:46 Key refused

Ich bin der Meinung, dass beim Key-Austausch irgend etwas nicht stimmt.

Hast Du lokal auf Deiner Kiste, mit der Du auf den Server zugreifen willst, den ssh-Key erstellt, und dann auf dem entfernten Server kopiert? Nur mal so zur Sicherheit gefragt. :confused:

rootforlife
18.10.04, 21:59
Ich habe beides schon probiert:

1. Schlüssel mit Puttygen erstellt und dann in authorized_keys2 eingefügt und auch

2. Schlüssel unter Linux erstellt und dann mit Puttygen konvertiert.

Das merkwürdige ist: Wenn ich einen falschen Schlüssel benutze, kommt eine andere Fehlermeldung (irgendetwas mit "Server" und "Key refused". Stimmt der Schlüssel, passiert jetzt das, was ich geschrieben habe.

Da muss irgendetwas nach dem Schlüsselabgleich noch "schief laufen" (schnief).

Danke aber schonmal für Eure Hilfsbereitschaft!

Hier ist noch meine sshd_conf:


# $OpenBSD: sshd_config,v 1.68 2003/12/29 16:39:50 millert 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
#ListenAddress 0.0.0.0
#ListenAddress ::

# HostKey for protocol version 1
# HostKey /etc/ssh/ssh_host_key
# HostKeys for protocol version 2
# HostKey /etc/ssh/ssh_host_rsa_key
# HostKey /etc/ssh/ssh_host_dsa_key

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

# Logging
#obsoletes QuietMode and FascistLogging
SyslogFacility AUTH
LogLevel DEBUG

# Authentication:

#LoginGraceTime 2m
#PermitRootLogin no
#StrictModes yes

RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile .ssh/authorized_keys2
AuthorizedKeysFile %h/.ssh/authorized_keys2


# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#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 yes

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

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes

# Set this to 'yes' to enable support for the deprecated 'gssapi' authentication
# mechanism to OpenSSH 3.8p1. The newer 'gssapi-with-mic' mechanism is included
# in this release. The use of 'gssapi' is deprecated due to the presence of
# potential man-in-the-middle attacks, which 'gssapi-with-mic' is not susceptible to.
#GSSAPIEnableMITMAttack no

# Set this to 'yes' to enable PAM authentication (via challenge-response)
# and session processing. Depending on your PAM configuration, this may
# bypass the setting of 'PasswordAuthentication' and 'PermitEmptyPasswords'
UsePAM yes

#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
----------------------------------------------------------------------
und die ssh aus dem pam.d Verzeichnis:

#%PAM-1.0
auth required pam_unix2.so # set_secrpc
auth required pam_nologin.so
auth required pam_env.so
account required pam_unix2.so
account required pam_nologin.so
password required pam_pwcheck.so
password required pam_unix2.so use_first_pass use_authtok
session required pam_unix2.so none # trace or debug
session required pam_limits.so
# Enable the following line to get resmgr support for
# ssh sessions (see /usr/share/doc/packages/resmgr/README.SuSE)
#session optional pam_resmgr.so fake_ttyname

Blade
19.10.04, 09:41
Hast Du das ganze mal zum Test mit einem Passwort getestet?

rootforlife
19.10.04, 21:56
Ja, Zugang per Passwort ist kein Problem. Das klappt. Aber ich möchte ja Zugang per Key (vor allem wegen winCSV).

Blade
20.10.04, 10:13
Hi,
nein, das hatte ich nicht gemeint. Meine Frage zielte darauf ab, ob der ssh-Zugang mit key und Passwort funktioniert? So könnte man das Problem eventuelle eingrenzen. Teste es doch mal, erstelle einen key mit User und Passwort und teste das Ganze mal.

temir
20.10.04, 18:13
hm, die 2 Zeilen aus der config:

#AuthorizedKeysFile .ssh/authorized_keys2
AuthorizedKeysFile %h/.ssh/authorized_keys2

kann das System mit dem '%h' was anfangen?

foolish
20.10.04, 20:15
hi,

--- sry, zu schnell überflogen --- aber vllt. hilft dieser Link hier um sich Anregung zu holen http://www.different-thinking.de/ssh2_howto.php