Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
ssh absichern scheitert :-(
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German)
View previous topic :: View next topic  
Author Message
hambuergaer
Apprentice
Apprentice


Joined: 08 Mar 2004
Posts: 294
Location: Hamburg

PostPosted: Fri Apr 22, 2005 3:01 pm    Post subject: ssh absichern scheitert :-( Reply with quote

hallo leute,

ich habe einen server frisch installiert und möchte jetzt ssh nach der anleitung auf der seite http://www.gentoo.org/doc/en/gentoo-security.xml absichern. ich habe also auf meinem notebook als user einen schlüssel erzeugt und per scp auf den server kopiert. dort habe ich ebenfalls den gleichen user erzeugt, wie auf meinem notebook. im user-verzeichnis auf dem server habe ich .ssh/authorized_keys erzeugt und den pub key in dieses verzeichnis kopiert. USE Pam habe ich auf no gesetzt. ich habe folgende fehlermeldung erhalten:

Permission denied (publickey,keyboard-interactive).

das gleich passiert, wenn ich anstatt dem verzeichnis authorized_keys eine datei mit diesem namen erzeuge und den inhalt des pub-keys dort hineinkopiere.

kann mir da jemand einen tip geben?
_________________
---------------------------------------------------------
wat is hier los?
Back to top
View user's profile Send private message
andix
Apprentice
Apprentice


Joined: 10 Jul 2004
Posts: 263
Location: Eisenstadt, Austria

PostPosted: Fri Apr 22, 2005 3:12 pm    Post subject: Reply with quote

authorized_keys ist eine Datei, kein Verzeichnis :!:
Du musst eine Datei authorized_keys anlegen, in der du pro Zeile einen Publickey einfügst. [EDIT:] Pass aber auf, dass dir dein editor nicht die Zeilen umbricht. So eine Publickey-Zeile kann schon ein paar Hundert zeichen lang sein.
Back to top
View user's profile Send private message
hambuergaer
Apprentice
Apprentice


Joined: 08 Mar 2004
Posts: 294
Location: Hamburg

PostPosted: Fri Apr 22, 2005 3:15 pm    Post subject: Reply with quote

muss ich den ganzen inhalt des pub-keys dort reinkopieren? denn das hab ich auch schon getan. muss ich in der sshd_config USE Pam ganz herausnehmen (aukommentieren), oder reicht es, wenn ich schreibe Use Pam no???


:-) hab gerade dein edit gesehen... das werde ich nochmal kontrollieren! danke für den tip!
_________________
---------------------------------------------------------
wat is hier los?
Back to top
View user's profile Send private message
andix
Apprentice
Apprentice


Joined: 10 Jul 2004
Posts: 263
Location: Eisenstadt, Austria

PostPosted: Fri Apr 22, 2005 5:27 pm    Post subject: Reply with quote

Lass den sshd zum Testen bei der Standard-Konfiguration. Ich weiß nicht, ob alles noch so funktioniert, wie du willst, wenn du PAM ausschaltest.

Publickey authentication geht in der Standardkonfiguration problemlos neben der "normalen" mit Passwort!
Back to top
View user's profile Send private message
Duncan Mac Leod
Guru
Guru


Joined: 02 May 2004
Posts: 313
Location: Germany

PostPosted: Fri Apr 22, 2005 8:14 pm    Post subject: Reply with quote

andix wrote:
Lass den sshd zum Testen bei der Standard-Konfiguration. Ich weiß nicht, ob alles noch so funktioniert, wie du willst, wenn du PAM ausschaltest.


Doch geht..!

Ich habe inzw. alle meine Gentoo Server auf Keys umgestellt...

Hier ein kurzer Auszug aus der sshd_config...
[...]
LoginGraceTime 2m
PermitRootLogin no
MaxAuthTries 6
PasswordAuthentication no
PermitEmptyPasswords no
PAMAuthenticationViaKbdInt no
UsePAM no
[...]

Den Rest der sshd entspricht in der Regel den Default-Settings...
Back to top
View user's profile Send private message
Fauli
l33t
l33t


Joined: 24 Apr 2004
Posts: 760
Location: Moers, Germany

PostPosted: Fri Apr 22, 2005 8:22 pm    Post subject: Reply with quote

Mit der Option -v werden bei der Anmeldung mit ssh mehr Debugging-Nachrichten ausgeben. Da könnte der entscheidende Hinweis drinstehen.
Back to top
View user's profile Send private message
toskala
Advocate
Advocate


Joined: 14 Dec 2002
Posts: 2080
Location: hamburg, germany

PostPosted: Fri Apr 22, 2005 9:07 pm    Post subject: Reply with quote

cat deinpubkey > ~/.ssh/AuthorizedKeys2

das ganze natürlich auf dem zielserver.

du möchtest pam abschalten in der config und du möchtest natürlich (wenn pubkey auth funktioniert) password auth abschalten, rootlogin verbieten, empty passwords verbieten, tunneling nebst x forwarding auch usw.
_________________
adopt an unanswered post
erst denken, dann posten
Back to top
View user's profile Send private message
flubber
Tux's lil' helper
Tux's lil' helper


Joined: 28 Dec 2004
Posts: 136

PostPosted: Fri Apr 22, 2005 11:43 pm    Post subject: Reply with quote

toskala wrote:
cat deinpubkey > ~/.ssh/AuthorizedKeys2


Kann ganz schön in die Hose gehen, es sei denn Du hast nur einen Key, wenn Du mehrere Keys, weil mehrere Benutzer,
mußt Du es so machen:
cat deinpubkey >> ~/.ssh/authorizedKeys

Flubber
Back to top
View user's profile Send private message
TheSmallOne
Guru
Guru


Joined: 22 Jan 2005
Posts: 467
Location: Germany

PostPosted: Sat Apr 23, 2005 7:40 am    Post subject: Reply with quote

Hm, ich schätze da wird die Datei ganz schön unübrsichtlich...

Ich weiß schon, warum ich das richtige SSH anstelle von OpenSSH benutze: Da liegen die Schlüssel jeweils schön ordentlich in ihrer eigenen Datei und die Authorisationsdatei bekommt lediglich einen Eintrag darauf.



Weiß jemand, wieso eigentlich standardmäßig OpenSSH installiert wird, ohne dem User überhaupt eine Wahl zu lassen?
Back to top
View user's profile Send private message
hambuergaer
Apprentice
Apprentice


Joined: 08 Mar 2004
Posts: 294
Location: Hamburg

PostPosted: Sat Apr 23, 2005 8:58 am    Post subject: Reply with quote

super... merci vielmals für all eure tips!!! läuft jetzt einwandfrei!
_________________
---------------------------------------------------------
wat is hier los?
Back to top
View user's profile Send private message
schachti
Advocate
Advocate


Joined: 28 Jul 2003
Posts: 3765
Location: Gifhorn, Germany

PostPosted: Sat Apr 23, 2005 9:51 am    Post subject: Reply with quote

TheSmallOne wrote:

Weiß jemand, wieso eigentlich standardmäßig OpenSSH installiert wird, ohne dem User überhaupt eine Wahl zu lassen?


Du hast doch die Wahl, OpenSSH zu entfernen und durch eine andere Version zu ersetzen. Bei Standardpaketen ist es nunmal so, daß man irgend eines als Standard festlegen muß, und die Wahl ist nunmal auf OpenSSH gefallen. :wink:
_________________
Never argue with an idiot. He brings you down to his level, then beats you with experience.

How-To: Daten verschlüsselt auf DVD speichern.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum