Problem bei SSH Absicherung mit Privatekey....?!

Muluske

Registered User
Hallo Leuts!
Ich wollte bei meinem VS den SSH mit Privatekey absichern.
Leider kann man sich immer noch mit Name und Passwort einloggen.

So bin ich vorgegangen:

Dummy erstellt:cool:

Code:
adduser scherzkeks
Code:
mkdir /home/scherzkeks/.ssh
Code:
chmod 700 /home/scherzkeks/.ssh
Code:
ssh-keygen -t rsa -b 8192
Code:
mv /home/id-rsa.pub /home/scherzkeks/.ssh/authorized_keys
Code:
chmod 600 /home/scherzkeks/.ssh/authorized_keys
Code:
chown -hR scherzkeks:scherzkeks /home/scherzkeks/.ssh
Code:
nano /etc/ssh/sshd_config
"Permit Root Login" auf no gesetzt und "Password-Auth" auf no gesetzt.
Code:
/etc/init.d/ssh restart

Mit PuTTY-Gen habe ich den PK konvertiert und gespeichert. Wenn ich mich nun mit dem PK unter
PuTTY->Auth einlogge funzt das wunderbar, nur kann ich mich aber auch wie gewohnt mit "scherzkeks" und Passwort im SSH und SFTP einloggen...:eek::confused:
Habe ich was vergessen? Eigentlich sollte es doch kein Passwort annehmen und nur über Privatkey zulassen?:mad:
Hat jemand eine Idee?
 
In der auth.log steht neben ca.100000 Fremd-Angriffen:rolleyes:, dass wenn sich "scherzkeks" einloggt sein Passwort akzeptiert wird.
In der sshd_config steht was ich ja schon geschrieben habe, dass das einloggen per Passwort auf no steht.
Ich weiß nicht was du genau wissen willst....:confused:
 
Poste doch mal deine gesamte sshd_config.
Einfach mal ein Schuss ins Blaue: UsePAM yes auf no ändern.
 
Hier ist die gesamte sshd_config:

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

# 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

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

# Logging
SyslogFacility AUTH
LogLevel INFO

# Authentication:
LoginGraceTime 120
PermitRootLogin no
StrictModes no

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 yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no

# Change to no to disable tunnelled clear text passwords
#PasswordAuthentication no

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

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes

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

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

# Allow client to pass locale environment variables
AcceptEnv LANG LC_*

Subsystem sftp /usr/lib/openssh/sftp-server

UsePAM yes
 
Code:
# Change to no to disable tunnelled clear text passwords
[COLOR="Red"]#[/COLOR]PasswordAuthentication no
Schau nochmal ganz genau hin...

BTW: Es heißt public key authentication.
 
Last edited by a moderator:
Schau nochmal ganz genau hin...

BTW: Es heißt public key authentication.

Hallo elias!
Du warst meine Rettung;)!
Jetzt funzt es, frage mich nur wo das # hergekommen ist:confused:
Aber egal, es funzt, es kommt nun bei "scherzkeks" PuTTY Fatal Error und das ist gut so:p
Danke nochmal an alle!!
 
Back
Top