PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Zugriff per ssh funktioniert nicht



Henner
02.06.05, 09:52
Hallo,

wenn ich von PC1per ssh auf PC2 zugreifen will habe ich keine Probleme.

Wenn ich den umgekehrten Weg nehmen will PC2 per ssh auf PC1, bekomme ich folgende Ausgabe:


ssh -l henner 192.168.1.3
henner@192.168.1.3's password:
Permission denied, please try again.
henner@192.168.1.3's password:
Permission denied, please try again.
henner@192.168.1.3's password:
Permission denied (publickey,password,keyboard-interactive).

Ist auf PC1 sshd falsch konfiguriert?

Henner

P.S.: Hier meine sshd_config von PC1:


# $OpenBSD: sshd_config,v 1.69 2004/05/23 23:59:53 dtucker 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/bin:/bin:/usr/bin:/usr/X11R6/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,1
Protocol 2
#ListenAddress 0.0.0.0
#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
#MaxAuthTries 6

#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, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication mechanism.
# Depending on your PAM configuration, this may bypass the setting of
# PasswordAuthentication, PermitEmptyPasswords, and
# "PermitRootLogin without-password". If you just want the PAM account and
# session checks to run without PAM authentication, then enable this but set
# ChallengeResponseAuthentication=no
#UsePAM no

#AllowTcpForwarding yes
#GatewayPorts no
X11Forwarding yes
#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/lib/ssh/sftp-server

Tomek
02.06.05, 09:54
Wie sieht denn die Datei /etc/ssh/sshd_config aus? Was steht in den entsprechenden Logfiles auf dem Server?

Henner
02.06.05, 09:57
Die /etc/ssh/sshd_config habe ich im ersten Posting angefügt.

Ich weiß nicht, in welchem Log-File ich nachsehen muß.

Henner

Tomek
02.06.05, 09:59
Bei Debian Woody solltest du in /var/log/syslog oder /var/log/auth.log gucken.

Ändere an der sshd_config folgende Zeile:

#PasswordAuthentication yes
in:

PasswordAuthentication yes
Danach ssh neustarten:

/etc/init.d/ssh reload
Nun sollte der Login funktionieren.

Henner
02.06.05, 10:36
Hallo Tomek,

danke für Deine schnelle Antwort. Ich habe den Eintrag auf PC1 geändert. PC2 hat leider immernoch keinen Zugriff.

Meldung von PC2:


ssh -l henner 192.168.1.3
The authenticity of host '192.168.1.3 (192.168.1.3)' can't be established.
RSA key fingerprint is 04:6a:bc:3a:41:63:a3:3d:1e:f5:11:f7:aa:13:4b:c3.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.1.3' (RSA) to the list of known hosts.
henner@192.168.1.3's password:
Permission denied, please try again.
henner@192.168.1.3's password:
Permission denied, please try again.
henner@192.168.1.3's password:
Permission denied (publickey,password,keyboard-interactive).


Hier die Logs von PC1:
auth.log

Jun 2 11:36:45 localhost sshd[7097]: Server listening on :: port 22.
Jun 2 11:36:45 localhost sshd[7097]: error: Bind to port 22 on 0.0.0.0 failed: Address already in use.
Jun 2 11:36:51 localhost gdm-autologin(pam_unix)[6915]: session opened for user henner by (uid=0)
Jun 2 11:37:20 localhost sshd[8177]: Failed password for henner from ::ffff:192.168.1.4 port 32867 ssh2

syslog

Jun 2 11:36:49 localhost crond[7420]: (CRON) STARTUP (fork ok)
Jun 2 11:36:50 localhost crond: crond Start succeeded
Jun 2 11:36:50 localhost rc: kheader wird gestartet: succeeded
Jun 2 11:36:50 localhost kernel: bootsplash 3.1.6-2004/03/31: looking for picture...<6>...found (800x600, 10640 bytes, v3).
Jun 2 11:36:50 localhost kernel: bootsplash: status on console 0 changed to on
Jun 2 11:36:50 localhost kernel: bootsplash 3.1.6-2004/03/31: looking for picture...<6>...found (800x600, 10640 bytes, v3).
Jun 2 11:36:50 localhost kernel: bootsplash: status on console 1 changed to on
Jun 2 11:36:50 localhost kernel: bootsplash 3.1.6-2004/03/31: looking for picture...<6>...found (800x600, 10640 bytes, v3).
Jun 2 11:36:50 localhost kernel: bootsplash: status on console 2 changed to on
Jun 2 11:36:50 localhost kernel: bootsplash 3.1.6-2004/03/31: looking for picture...<6>...found (800x600, 10640 bytes, v3).
Jun 2 11:36:50 localhost kernel: bootsplash: status on console 3 changed to on
Jun 2 11:36:50 localhost kernel: bootsplash 3.1.6-2004/03/31: looking for picture...<6>...found (800x600, 10640 bytes, v3).
Jun 2 11:36:50 localhost kernel: bootsplash: status on console 4 changed to on
Jun 2 11:36:50 localhost kernel: bootsplash 3.1.6-2004/03/31: looking for picture...<6>...found (800x600, 10640 bytes, v3).
Jun 2 11:36:50 localhost kernel: bootsplash: status on console 5 changed to on
Jun 2 11:36:53 localhost net_applet[7909]: ### Program is starting ###
Jun 2 11:36:53 localhost kernel: i2c_adapter i2c-0: sendbytes: error - bailout.
Jun 2 11:36:53 localhost kernel: tda9885/6/7: i2c i/o error: rc == -14 (should be 4)
Jun 2 11:36:53 localhost kernel: i2c_adapter i2c-0: sendbytes: error - bailout.
Jun 2 11:36:53 localhost kernel: tda9885/6/7: i2c i/o error: rc == -14 (should be 4)
Jun 2 11:36:53 localhost kernel: i2c_adapter i2c-0: sendbytes: error - bailout.
Jun 2 11:36:53 localhost kernel: tda9885/6/7: i2c i/o error: rc == -14 (should be 4)
Jun 2 11:36:55 localhost kernel: eth0: no IPv6 routers present
Jun 2 11:36:56 localhost gconfd (henner-8000): (Version 2.8.1) wird gestartet, Prozesskennung 8000, Benutzer »henner«
Jun 2 11:36:57 localhost gconfd (henner-8000): Die Adresse »xml:readonly:/etc/gconf/gconf.xml.mandatory« wurde an der Position 0 zu einer nur lesbaren Konfigurationsquelle aufgelöst
Jun 2 11:36:57 localhost gconfd (henner-8000): Die Adresse »xml:readwrite:/home/henner/.gconf« wurde an der Position 1 zu einer schreibbaren Konfigurationsquelle aufgelöst
Jun 2 11:36:57 localhost gconfd (henner-8000): Die Adresse »xml:readonly:/etc/gconf/gconf.xml.defaults« wurde an der Position 2 zu einer nur lesbaren Konfigurationsquelle aufgelöst
Jun 2 11:36:58 localhost kernel: ISO 9660 Extensions: Microsoft Joliet Level 3
Jun 2 11:36:58 localhost kernel: ISO 9660 Extensions: RRIP_1991A

Henner
02.06.05, 10:49
Alles Zurück!!!

Als root kann ich mich nun einloggen. aber nicht als User henner.

Der user henner hat auf PC1 kein Passwort (also Login ohne Passwort). Damit scheint ssh nicht zurecht zu kommen.

Gibt es dafür auch eine Lösung?

Henner

Tomek
02.06.05, 13:32
Ein User der kein Passwort hat, darf sich auch nicht einloggen. Gib dem User ein Passwort oder arbeite mit Schlüsseln.

temir
02.06.05, 13:34
Siehe `man sshd_config` (PermitEmptyPasswords) - ist aber nicht sicher.
Besser wärs mit keypair (geht mit passwd oder ohne), - und dieses Thema ist
hier schon oft diskutiert worden.