PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Problem: SSH mit RSA Authentification



TheAnimal
01.01.05, 21:32
Hallo Zusammen,
ich möchte mich auf meinem Server mittels RSA Authentification anmelden. Es handelt sich um ein Debian System mit Confixx.

Ich habe auf meinem Windows Rechner mit Putty zwei Keys erstellt.
In /root/.ssh/autrorized_keys habe ich den Public Key von Putty reinkopiert.
Meine /etc/ssh/sshd_config sieht folgendermaßen aus:

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

# 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
#Privilege Separation is turned on for security
UsePrivilegeSeparation yes

# ...but breaks Pam auth via kbdint, so we have to turn it off
# Use PAM authentication via keyboard-interactive so PAM modules can
# properly interface with the user (off due to PrivSep)
PAMAuthenticationViaKbdInt no
# 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

# rhosts authentication should not be used
RhostsAuthentication no
# 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

# Uncomment to disable s/key passwords
#ChallengeResponseAuthentication no

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


# 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 no
KeepAlive yes
#UseLogin no

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

Subsystem sftp /usr/lib/sftp-server


Wenn ich mich jetzt über Putty mit dem Key anmelden will kommt folgende Meldung: "Server refused our key"

Woran kann das liegen?? Haben schon viel rum probiert. Leider bekomme ich es nicht hin.

Kann mir jemand helfen??

Danke im voraus
TheAnimal

chpl
01.01.05, 21:40
Hallo

Ich habe leider keine Lösung !
Aber ich bin gerade bei dem gleichen Problem :)
Ich sag mal was ich alles schon versucht habe vielleicht kann
man sich ja ergänzen....

Soviel ich rausbekommen habe sind die keys die putty erzeugt
nicht ganz kompatibel
mit ssh-keygen -i kann man sie zu einem openssh key konvertieren.
Ansonsten heißt es laut hilfe das es an der Server einstellung liegt ...
Aber welche habe ich leider auch noch nicht rausgefunden :(

mfg chpl

Dewitt
01.01.05, 22:58
Wie sieht denn euer Key aus?

Wenn ihr PuttyGen startet und einen Key generiert, könnt ihr ja Private & Public Key abspeichern. Das ist schonmal gut.

Oben gibt es aber auch einen Abschnitt, in dem der OpenSSH Key drinnen steht. Den Text müsst ihr kopieren und in eure authorized_keys kopieren.

chpl
01.01.05, 23:25
hi
meine public key:

ssh-dss AAAAB3NzaC1kc3MAAACBAItlCHXjRsqkvBnP6LH90QfxpZinfO tz7PB5o0aN1y5
........
........
fCfoVK8MrXW96YmBoSlaOAM3VGtwXt8fZsUqJAhVXuPdWklEqi Bo9IV4baCLzb
hd97E0vaedZgQkT/Ueplw== cp@localhost.localdomain

mein private key
-----BEGIN DSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,E1A67FB12FB767BF

ArpY9gRUvgefCqb80GHbmDA0PpctydqmsquJPSFGJRA3C9Ax23 hTLZ92bLVVPC7b
MJGqEqDNCJaFni2ufJpRAdgXHd2pboIQLMYSmGC20m+rPTSXDl NcvyD+Nxl5GHFJ
.....
.....
.....
L8Fv9NhIgahJibpVSo+Ptf/0t2iI3kmQJvJS2jq350RoTT9YPoGfdHf4miYOV4NY
nHaEC76h89X2R3HAAbM/iYvuNnCEC395oSQ1RqKSSNds9ETinFMSb6M2Nmre45xM
pWW/52lFcdDDCHm3n8lumQ==
-----END DSA PRIVATE KEY-----

der public key nach dem konvertieren sieht ...
PuTTY-User-Key-File-2: ssh-rsa
Encryption: aes256-cbc
Comment: rsa-key-20050101
Public-Lines: 4
AAAAB3NzaC1yc2EAAAABJQAAAIB2Q3Bno2z7EHHfvtp33/bOuVtVXbLUl+w8iDoD
x17+dVqBBMoPp0UKy9yL312kESQxI3Rg1bXEs7QnBbXFZRKPzN Hla+Nuag8PTavM
......
......
e+cL7rjnlVn+GuHUEyJluwfHLOxpOSTZJqf3NpJtdBnGxGlHHd K7EKMW+QiyvXPF
hE3o1qpI22B/ZPnYi7s2NA==
Private-MAC: b6202d4ed000a817c38bb56a2e411d81f6e5139e

aus kann man da einen fehler erkennen ??

mfg chpl

TheAnimal
02.01.05, 12:42
Hallo Zusammen,

also was mir auch noch so ein paar probleme bereitet ist Version 1 und Version 2. Wie stelle ich ein, welche Version ich benutzen will??

Also mein Public Key für Version 2 sieht in etwa so aus:

---- BEGIN SSH2 PUBLIC KEY ----
Comment: "rsa-key-20041231"
AAAAB3NzaC1yc2EAAAABJQAAAIEAiNRnTz7rWlnriEfMWVDpKU sTxvsv4MYF52c7
......
......
htSf0Y8=
---- END SSH2 PUBLIC KEY ----

Mein Privat Key für Version sieht so aus:

PuTTY-User-Key-File-2: ssh-rsa
Encryption: none
Comment: rsa-key-20041231
Public-Lines: 4
AAAAB3NzaC1yc2EAAAABJQAAAIEAiNRnTz7rWlnriEfMWVDpKU sTxvsv4MYF52c7
4mAI7ASlVeiICE9toUcnMI8Ek/aeyInMcO+uKW1rO5hMVyzYknzB1k6S5O1mhTmc
R/npbKkxnEoMyrKv0chCUgrp+fhsPoT6nuxQySZWrIe4Dwey4cPU S4LZHNcjYOG/
htSf0Y8=
Private-Lines: 8
AAAAgAOytq8dYE6MzwOu6djmgteaPs4GyfFRdcf73wYeRW4po5 qJvnzD4F5OB/pk
.....
.....
.....
qeVlPYY6bvEQf4XT80oSPxFxAMU9UDjY/bume3gWmm7kPC6nAyc5KVtAQS2QApDG
NDitoW+y+C4LAAAAQQCQNu22O8Ly8C1T/mw5Ke9coNt4Edy4fzZ1yoNPp048uWk0
.....
.....
7
RQs=
Private-MAC: 2649a0c79076e1286767d99a0b232cd894441024

Muß ich den den unbedingt umwandeln??

Vielleicht bekommen wir das ja hin.
Gruß
TheAnimal


PS: Wenn ich mit ssh-keygen -i meinen Public Key umwandel sieht der genauso aus wie vorher.

chpl
02.01.05, 17:37
Hi

wegen dem umwandeln:
wenn ich das nicht mache sagt er mir invalied key ...

>>PS: Wenn ich mit ssh-keygen -i meinen Public Key umwandel sieht der >>genauso aus wie vorher.

nun der key wird dadurch nicht angerührt aber
ssh-keygen -i spuckt dir direckt in die console den key aus ..
den hab ich copiert und in authorized.keys eingefügt...

wenn man direkt mit ssh-keygen einen erzeugt dann kann man ihn
mit putty nicht nutzen ... man kann ihn aber mit dem puttykegen laden
und als privatekey speichern dann kann putty ihn benutzen ...

alerdings sagt er bei mir immer noch refused key :(

mfg chpl

TheAnimal
02.01.05, 19:29
Hi,
also invalid key hatte ich überhaupt nicht. Kommt immer nur refused key.

Weiß nicht was man da noch machen kann.

Gruß
TheAnimal

chpl
04.01.05, 01:04
hi

ich hab jetzt mal versucht mich dirket am lokalhost mit ssh zu verbinden
sollte doch gehen ...
geht aber nicht ...
ich hab jetzt schon zick anleitungen durch alle wiedersprechen
sich in hinsicht der rechte die das authorized.keys haben muss.
und auch für die rechte des .ssh verzeichnises.

notfalls sollte man StrictMode no setzten können aber auch das klappt nicht
welche einstellungen muss den der server jetzt haben ??
hat wirklich keiner rat :(

mfg chpl

chpl
04.01.05, 01:16
hmm

wer lesen kann ist klar im vorteil :D
grmml das file heißt ja authorized_keys und nicht authorized.keys

arrg jetzt funktioniert natürlich alles :)

mfg chpl