PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : SSH und Schlüssel!



root_tux_linux
18.02.05, 11:59
Hi

Ich hab jetzt meine Kiste nach dem Sicherheitsleitfaden von gentoo abgeschottet bei SSH jedoch klappt einiges nicht!

Die /etc/ssh/sshd_config hab ich so umgeschrieben wie es in der Anleitung sand.
Ich hab auch ein Schlüsselpaar generiert (privat/öffentlich) und den id_dsa.pub auf den Server geladen bzw in den Ordner des Users auf dem Server den ich nutzen will für den Login (~/.ssh/authorized_keys).

Wenn ich danach SSHD neustarte gibts eine Fehlemeldung angeblich stimmt die Option "RhostsAuthentication no" nicht!


/etc/ssh/sshd_config line 121: Deprecated option RhostsAuthentication no


Wenn ich die Option auf "RhostsRSAAuthentication no" ändere gibts keine Fehlermeldung mehr aber!!!

Wenn ich mich dann versuch einzuloggen gibts folgende Fehlermeldung aus:


Permission denied (publickey,keyboard-interactive).


Debug gibt folgendes aus:


benutzername@gentoo benutzername $ ssh -v mldonkey.linux
OpenSSH_3.9p1, OpenSSL 0.9.7e 25 Oct 2004
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to mldonkey.linux [192.168.2.14] port 22.
debug1: Connection established.
debug1: identity file /home/benutzername/.ssh/identity type -1
debug1: identity file /home/benutzername/.ssh/id_rsa type -1
debug1: identity file /home/benutzername/.ssh/id_dsa type 2
debug1: Remote protocol version 2.0, remote software version OpenSSH_3.9p1
debug1: match: OpenSSH_3.9p1 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_3.9p1
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'mldonkey.linux' is known and matches the RSA host key.
debug1: Found key in /home/benutzername/.ssh/known_hosts:3
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Trying private key: /home/benutzername/.ssh/identity
debug1: Trying private key: /home/benutzername/.ssh/id_rsa
debug1: Offering public key: /home/benutzername/.ssh/id_dsa
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Next authentication method: keyboard-interactive
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: No more authentication methods to try.
Permission denied (publickey,keyboard-interactive).
benutzername@gentoo benutzername $

Kann mir jemand verraten was da Falsch ist den ich bin 1:1 nach dem Sicherheitsleitfaden vorgegangen!

Polarizer
18.02.05, 15:00
Müssen die dsa pub-keys nicht in der Datei
~/.ssh/authorized_keys2 stehen. Stimmen die Zugriffsrechts für das
~./ssh Verzeichnis und die Dateien darin?!

Hope that helps

root_tux_linux
18.02.05, 20:17
root@mldonkey:/home/benutzername/.ssh# ls -l
total 0
drwxr-xr-x 2 benutzername users 23 2005-02-18 12:25 authorized_keys2
root@mldonkey:/home/benutzername/.ssh#



root@mldonkey:/home/benutzername# ls -la
total 4
drwxr-xr-x 3 benutzername users 37 2005-02-18 11:01 .
drwxr-xr-x 3 root root 20 2005-02-16 05:48 ..
-rw------- 1 benutzername users 675 2005-02-18 12:42 .bash_history
drwxr-xr-x 3 benutzername users 29 2005-02-18 20:14 .ssh
root@mldonkey:/home/benutzername#



root@mldonkey:/home/benutzername# cat /etc/ssh/sshd_config
# $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/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin

# 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 192.168.2.14
#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 INFO

# Authentication:

#LoginGraceTime 2m
#PermitRootLogin no
#StrictModes yes

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

# 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 yes
#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 PAM authentication (via challenge-response)
# and session processing. Depending on your PAM configuration, this may
# bypass the setting of 'PasswordAuthentication' and 'PermitEmptyPasswords'
#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/libexec/sftp-server
GatewayPorts no
AllowTcpForwarding yes
LoginGraceTime 360
KeepAlive yes
IgnoreRhosts yes
IgnoreUserKnownHosts no
PrintMotd no
StrictModes yes
RSAAuthentication yes


#Protokoll
Protocol 2

#Port
Port 22

# Root Login deaktivieren
PermitRootLogin no

#Deaktivieren von .rhost und normaler Passwortauthentifizierung
PermitEmptyPasswords no
PasswordAuthentication no
#RhostsRSAAuthentication no
#IgnoreRhosts yes

#Public key Authentifizierung aktivieren
PubkeyAuthentication yes

#Erlaubte Benutzer
AllowUsers benutzername

#Nicht erlaubte Benutzer
#DenyUsers root

#Nicht erlaubte Gruppen
#DenyGroups root bin daemon sys adm disk floppy wheel

#Erlaubte Gruppen
AllowGroups users

#Erlaubte Hosts
#AllowHosts *.linux


#Logging
SyslogFacility AUTH
LogLevel INFO

#An diese IP binden
#ListenAddress 192.168.2.*

id_dsa hat chmod 600

Ich habs schon mit authorized_keys versucht, ohne AllowHosts.

Btw. Mit AllowHosts gibts ne Fehlermeldung von wegen Bad operation o.ä.

root_tux_linux
19.02.05, 00:32
Hat sich erledigt ;)

Die Gentoo Anleitung ist einfach nur mies und nicht up2date!

Hab mit ner Anleitung von Debian gemacht lief alles problemlos!


http://www.debianhowto.de/howtos/de/sshconfig/c_sshconfig.html#sshconfig_intro