PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : sshd Problem



seufert.st
11.01.07, 15:29
ich habe auf einem debian einen sshd eingerichtet. Funktioniert soweit einfandfrei, nur der login mit schlüsseldatei funktioniert nicht.
Ich bekomme vom sshd folgendes protokoll:



debug1: sshd version OpenSSH_3.8.1p1 Debian-8.sarge.4
debug1: read PEM private key done: type RSA
debug1: private host key: #0 type 1 RSA
debug1: read PEM private key done: type DSA
debug1: private host key: #1 type 2 DSA
socket: Address family not supported by protocol
debug1: Bind to port 1031 on 0.0.0.0.
Server listening on 0.0.0.0 port 1031.
socket: Address family not supported by protocol
debug1: Bind to port 22 on 0.0.0.0.
Server listening on 0.0.0.0 port 22.
debug1: Server will not fork when running in debugging mode.
Connection from 212.168.165.192 port 62533
debug1: Client protocol version 2.0; client software version PuTTY_Release_0.58
debug1: no match: PuTTY_Release_0.58
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_3.8.1p1 Debian-8.sarge.4
debug1: permanently_set_uid: 102/65534
debug1: list_hostkey_types: ssh-rsa,ssh-dss
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: client->server aes256-cbc hmac-sha1 none
debug1: kex: server->client aes256-cbc hmac-sha1 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST_OLD received
debug1: SSH2_MSG_KEX_DH_GEX_GROUP sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_INIT
debug1: SSH2_MSG_KEX_DH_GEX_REPLY sent
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: KEX done
debug1: userauth-request for user sst service ssh-connection method none
debug1: attempt 0 failures 0
Failed none for sst from 212.168.165.192 port 62533 ssh2
debug1: PAM: initializing for "sst"
debug1: PAM: setting PAM_RHOST to "u26-192.dsl.vianetworks.de"
debug1: PAM: setting PAM_TTY to "ssh"
debug1: userauth-request for user sst service ssh-connection method publickey
debug1: attempt 1 failures 1
debug1: test whether pkalg/pkblob are acceptable
debug1: temporarily_use_uid: 65002/107 (e=0/0)
debug1: trying public key file /home/sst/.ssh/authorized_keys
debug1: restore_uid: 0/0
debug1: temporarily_use_uid: 65002/107 (e=0/0)
debug1: trying public key file /home/sst/.ssh/authorized_keys
debug1: restore_uid: 0/0
Failed publickey for sst from 212.168.165.192 port 62533 ssh2
debug1: userauth-request for user sst service ssh-connection method keyboard-interactive
debug1: attempt 2 failures 2
debug1: keyboard-interactive devs
debug1: auth2_challenge: user=sst devs=
debug1: kbdint_alloc: devices 'pam'
debug1: auth2_challenge_start: trying authentication method 'pam'
Postponed keyboard-interactive for sst from 212.168.165.192 port 62533 ssh2



Meine sshd_config sieht so aus:



# Package generated configuration file
# See the sshd(8) manpage for details

# What ports, IPs and protocols we listen for
Port 22
Port 1031
# 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
#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 600
PermitRootLogin no
StrictModes yes

RSAAuthentication yes
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 no to disable s/key passwords
#ChallengeResponseAuthentication yes

# Change to yes to enable tunnelled clear text passwords
PasswordAuthentication no

# To change Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#AFSTokenPassing no
#KerberosTicketCleanup no

# Kerberos TGT Passing does only work with the AFS kaserver
#KerberosTgtPassing yes

X11Forwarding no
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
KeepAlive yes
#UseLogin no

#MaxStartups 10:30:60
#Banner /etc/issue.net

Subsystem sftp /usr/lib/sftp-server

UsePAM yes

# Nur der Gruppe ssh_users den Zugang per ssh gestatten
AllowGroups ssh_users



Hoffentlich kann mir da jemand helfen... ich bin am verzweifeln... An den Schlüsseln denke ich nicht dass es liegt, die hab ich schon x mal neu erstellt und auch die Berechtigungen angepasst!

DANKE DANKE DANKE

temir
11.01.07, 15:52
Ausgabe von `ls -la /home/sst/.ssh/` posten.

seufert.st
11.01.07, 15:58
komme jetzt gar nicht mehr auf das ding... installiere ihn neu... wenn das problem weiter besteht, melde ich mich morgen noch mal

aber trotzdem danke

seufert.st
11.01.07, 16:21
so, bin wieder da... altes Problem
das system ist nackt, frisch installiert, den login versuche ich momentan noch als root

sshd -d



debug1: sshd version OpenSSH_3.8.1p1 Debian-8.sarge.4
debug1: read PEM private key done: type RSA
debug1: private host key: #0 type 1 RSA
debug1: read PEM private key done: type DSA
debug1: private host key: #1 type 2 DSA
socket: Address family not supported by protocol
debug1: Bind to port 1031 on 0.0.0.0.
Server listening on 0.0.0.0 port 1031.
socket: Address family not supported by protocol
debug1: Bind to port 22 on 0.0.0.0.
Server listening on 0.0.0.0 port 22.
debug1: Server will not fork when running in debugging mode.
Connection from 212.168.165.192 port 63764
debug1: Client protocol version 2.0; client software version PuTTY_Release_0.58
debug1: no match: PuTTY_Release_0.58
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_3.8.1p1 Debian-8.sarge.4
debug1: permanently_set_uid: 102/65534
debug1: list_hostkey_types: ssh-rsa,ssh-dss
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: client->server aes256-cbc hmac-sha1 none
debug1: kex: server->client aes256-cbc hmac-sha1 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST_OLD received
debug1: SSH2_MSG_KEX_DH_GEX_GROUP sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_INIT
debug1: SSH2_MSG_KEX_DH_GEX_REPLY sent
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: KEX done
debug1: userauth-request for user root service ssh-connection method none
debug1: attempt 0 failures 0
Failed none for root from 212.168.165.192 port 63764 ssh2
debug1: PAM: initializing for "root"
debug1: PAM: setting PAM_RHOST to "u26-192.dsl.vianetworks.de"
debug1: PAM: setting PAM_TTY to "ssh"
debug1: userauth-request for user root service ssh-connection method publickey
debug1: attempt 1 failures 1
debug1: test whether pkalg/pkblob are acceptable
debug1: temporarily_use_uid: 0/0 (e=0/0)
debug1: trying public key file /root/.ssh/authorized_keys
debug1: restore_uid: 0/0
debug1: temporarily_use_uid: 0/0 (e=0/0)
debug1: trying public key file /root/.ssh/authorized_keys2
debug1: restore_uid: 0/0
Failed publickey for root from 212.168.165.192 port 63764 ssh2
debug1: userauth-request for user root service ssh-connection method keyboard-interactive
debug1: attempt 2 failures 2
debug1: keyboard-interactive devs
debug1: auth2_challenge: user=root devs=
debug1: kbdint_alloc: devices 'pam'
debug1: auth2_challenge_start: trying authentication method 'pam'
Postponed keyboard-interactive for root from 212.168.165.192 port 63764 ssh2



sshd_config:


# Package generated configuration file
# See the sshd(8) manpage for details

# What ports, IPs and protocols we listen for
Port 22
Port 1031
# 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
#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 600
PermitRootLogin yes
StrictModes yes

RSAAuthentication yes
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 no to disable s/key passwords
#ChallengeResponseAuthentication yes

# Change to yes to enable tunnelled clear text passwords
PasswordAuthentication no

# To change Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#AFSTokenPassing no
#KerberosTicketCleanup no

# Kerberos TGT Passing does only work with the AFS kaserver
#KerberosTgtPassing yes

X11Forwarding no
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
KeepAlive yes
#UseLogin no

#MaxStartups 10:30:60
#Banner /etc/issue.net

Subsystem sftp /usr/lib/sftp-server





DANKE DANKE DANKE

seufert.st
11.01.07, 16:26
total 6
drwxrwxr-x 2 root root 2048 Jan 11 16:22 .
drwx------ 3 root root 2048 Jan 11 16:22 ..
-rw------- 1 root root 1117 Jan 11 16:10 authorized_keys


Und hier noch die gewünschte aussage... Ich habe das System jetzt erst mal nackt gelassen, um alle Fehler auszuschließen

Nochmals DANKE, weil ich weiss nicht mehr weiter

shogun
11.01.07, 16:31
Hallo,

ssh ist bei den Verzeichnisrechten für das Home und das .ssh-Verzeichnis sehr restriktiv.
Versuch mal, bei beiden Verzeichnissen die Schreibrechte für die Gruppe und die Others wegzunehmen.

Gruß
Thomas

seufert.st
11.01.07, 19:13
Hallo shogun, danke für die rasche antwort... Die rechte auf die Verzeichnise /root (homeverzeichnis), .ssh und authorized_keys sind alle 600... Daher sollte das Problem nicht stammen! Hat noch jemand ideen???

DANKE

tschloss
11.01.07, 22:16
Hallo shogun, danke für die rasche antwort... Die rechte auf die Verzeichnise /root (homeverzeichnis), .ssh und authorized_keys sind alle 600... Daher sollte das Problem nicht stammen! Hat noch jemand ideen???

DANKE

authorized_keys ist eine Datei

edit: ooops oben stehts ja....

cane
12.01.07, 00:00
Hat noch jemand ideen???

Jawoll:

In der sshd.config "UsePAM yes" durch "UsePAM no" ersetzen, dann den SSHD per "/etc/init.d/sshd restart" neu hochjagen und nochmal testen.

mfg
cane

tschloss
12.01.07, 08:00
debug1: userauth-request for user root service ssh-connection method publickey
debug1: attempt 1 failures 1
debug1: test whether pkalg/pkblob are acceptable
debug1: temporarily_use_uid: 0/0 (e=0/0)
debug1: trying public key file /root/.ssh/authorized_keys
debug1: restore_uid: 0/0
debug1: temporarily_use_uid: 0/0 (e=0/0)
debug1: trying public key file /root/.ssh/authorized_keys2
debug1: restore_uid: 0/0
Failed publickey for root from 212.168.165.192 port 63764 ssh2

Er kommt ja schon in die pubkey-Situation hinein.
Hast du denn die Keys auch richtig aufbereitet, d.h. zB den private key mit puttygen konvertiert bevor du die Datei in Putty verlinkst? Und der authorized_keys ist einfach die umbenannte .pub-Datei?

seufert.st
12.01.07, 08:15
Hallo,

ich erstelle mit puttygen einen SSH-2 Schlüssel mit 2048 bit. Den private Key speichere ich ab, den Key kopiere ich aus der Box und füge Ihn in der Datei authorized_keys ab...
Dann gebe ich bei putty unter -ssh -auth den Schlüssel ein, und ab geht die Post (oder auch nicht :mad:)
Ich hoffe euch fällt noch was ein... DANKE


In der sshd.config "UsePAM yes" durch "UsePAM no" ersetzen, klappt auch nicht... hatte ich schon mal versucht

tschloss
12.01.07, 08:28
Hallo,

ich erstelle mit puttygen einen SSH-2 Schlüssel mit 2048 bit. Den private Key speichere ich ab, den Key kopiere ich aus der Box und füge Ihn in der Datei authorized_keys ab...
Dann gebe ich bei putty unter -ssh -auth den Schlüssel ein, und ab geht die Post (oder auch nicht :mad:)
Ich hoffe euch fällt noch was ein... DANKE


In der sshd.config "UsePAM yes" durch "UsePAM no" ersetzen, klappt auch nicht... hatte ich schon mal versucht

Putty und openssh - Keys sind vom Format inkompatibel und müssen konvertiert werden. Vor ein paar Tagen gab es einen Thread mit einer Anleitung zur Konvertierung.
http://www.linuxforen.de/forums/showpost.php?p=1482492&postcount=4

shogun
12.01.07, 09:28
total 6
drwxrwxr-x 2 root root 2048 Jan 11 16:22 .
drwx------ 3 root root 2048 Jan 11 16:22 ..
-rw------- 1 root root 1117 Jan 11 16:10 authorized_keys


Und hier noch die gewünschte aussage... Ich habe das System jetzt erst mal nackt gelassen, um alle Fehler auszuschließen

Nochmals DANKE, weil ich weiss nicht mehr weiter

Bist Du sicher, dass die Rechte für das .ssh-Verzeichnis auf 600 stehen?
Nach Deinem Posting sollten sie 775 sein.
(Siehe den Eintrag bei .)
Zumindest wenn du `ls -la /home/sst/.ssh/` eingegeben hast.

Gruß
Thomas

seufert.st
13.01.07, 10:20
Putty und openssh - Keys sind vom Format inkompatibel und müssen konvertiert werden. Vor ein paar Tagen gab es einen Thread mit einer Anleitung zur Konvertierung.
http://www.linuxforen.de/forums/showpost.php?p=1482492&postcount=4

Vielen DANK, ich habe zwar x tutorials gelesen, und mich genau danach verhalten, leider waren die aber dann wohl falsch.
Hat jetzt jedenfalls geklappt!
DANKE DANKE DANKD

tschloss
13.01.07, 11:40
Vielen DANK, ich habe zwar x tutorials gelesen, und mich genau danach verhalten, leider waren die aber dann wohl falsch.
Hat jetzt jedenfalls geklappt!
DANKE DANKE DANKD

Fein.

Ich finde den umgekehrten Weg deswegen besser: Keys mit OpenSSH erzeugen und den Private Key komfortabel mit puttygen konvertieren (letzteres kann OpenSSH-Keys importieren und als Putty Key abspeichern).