ssh mit Host basierender Authentifierung
Hi, ich möchte mit rsync die Daten auf meinen Web-Server HEINZ (heinz.fasel.de) (Suse7.3) auf einer anderen Suse GERD (suse8.0) sichern. Vorgehen (nach : http://www.vertexnet.de/docu/rsync/ und http://www.uni-karlsruhe.de/~ssh/pubkey.html ) Überprüfe ob rsync auf beiden Rechnern installiert ist. GERD: Schlüssel erstellen: ssh-keygen -t rsa1 wird /root/.ssh/heinz.id_dsa erstelle : /root/.ssh/config mit folgenden Inhalt: Host *.fasel.de User root Compression yes Protocol 2 RSAAuthentication yes StrictHostKeyChecking no ForwardAgent yes ForwardX11 yes IdentityFile /root/.ssh/heinz.id_dsa kopiere heinz.id_dsa.pub nach authorized_keys HEINZ: kopiere die authorized_keys von GERD nach /root/.ssh/authorized_keys auf HEINZ authorized_keys auch nach authorized_keys2 kopiert Teste mit /usr/bin/rsync -e "ssh -l root" -avzp --delete /home/roessler/ root@gerd:/home/roessler2/ Das klappt wunderbar, nur ... Mein Problem : Es wird immer noch das Passwort abgefragt. Irgendwas habe ich übersehen! Danke Ingo ################################################################# gerd:~/.ssh # ssh -V OpenSSH_3.0.2p1, SSH protocols 1.5/2.0, OpenSSL 0x0090603f gerd:~/.ssh # cat /etc/ssh/sshd_config Port 22 Protocol 2,1 ListenAddress 0.0.0.0 # 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 3600 ServerKeyBits 768 # Logging SyslogFacility AUTH LogLevel INFO #obsoletes QuietMode and FascistLogging # Authentication: LoginGraceTime 600 PermitRootLogin yes StrictModes yes LoginGraceTime 600 PermitRootLogin yes StrictModes yes RSAAuthentication yes PubkeyAuthentication yes AuthorizedKeysFile %h/.ssh/authorized_keys2 # 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/ssh_known_hosts RhostsRSAAuthentication no # similar for protocol version 2 HostbasedAuthentication yes # To disable tunneled clear text passwords, change to no here! PasswordAuthentication yes PermitEmptyPasswords no # Uncomment to disable s/key passwords ChallengeResponseAuthentication no X11Forwarding yes X11DisplayOffset 10 PrintMotd yes #PrintLastLog no KeepAlive yes Subsystem sftp /usr/lib/ssh/sftp-server ################################################################## heinz:~/.ssh # ssh -V OpenSSH_2.9p2, SSH protocols 1.5/2.0, OpenSSL 0x0090602f heinz:~/.ssh # cat /etc/ssh/ssh_config Host * # ForwardAgent no # ForwardX11 no # RhostsAuthentication no # RhostsRSAAuthentication yes RSAAuthentication yes PasswordAuthentication yes # FallBackToRsh no # UseRsh no # BatchMode no # CheckHostIP yes # StrictHostKeyChecking yes # IdentityFile ~/.ssh/identity IdentityFile ~/.ssh/id_dsa # IdentityFile ~/.ssh/id_rsa # Port 22 Protocol 1,2 # Cipher blowfish # EscapeChar ~
Hallo,
Ingo Rößler
Hi,
ich möchte mit rsync die Daten auf meinen Web-Server HEINZ (heinz.fasel.de) (Suse7.3) auf einer anderen Suse GERD (suse8.0) sichern.
[...]
Irgendwas habe ich übersehen!
[...] Bei mir war es die Inkompatibilität eines altes openssh Paketes mit einer neueren Version. Führe mal ssh -v aus. Da sollte dann ........ debug1: authentications that can continue: publickey,password debug1: next auth method to try is publickey .... jetzt sollte ein Error kommen .... debug1: authentications that can continue: publickey,password debug1: next auth method to try is password .... Das sollte dann erfolgreich sein. -Dieter -- Dieter Kluenter | Systemberatung Tel:040.64861967 | Fax: 040.64891521 mailto: dkluenter@schevolution.com http://www.schevolution.com/tour
Am Dienstag, 25. März 2003 11:00 schrieb Ingo Rößler:
Schlüssel erstellen: ssh-keygen -t rsa1
Würd ich nicht machen, aus Sicherheitsgründen sollte ssh2 verwendet werden und demzufolge wäre ein -t dsa angesagt.
wird /root/.ssh/heinz.id_dsa
erstelle : /root/.ssh/config mit folgenden Inhalt:
Host *.fasel.de User root Compression yes Protocol 2 ^^^^^^^^^^ Was hier auch der Fall ist, dafür liegt kein KEy vor.
Mein Problem :
Es wird immer noch das Passwort abgefragt.
Logisch, siehe oben.
gerd:~/.ssh # ssh -V ... Protocol 2,1
Der Rechner verwendet ssh2 und wenns nicht geht, ssh1
heinz:~/.ssh # cat /etc/ssh/ssh_config ... Protocol 1,2
Der hier ssh1 und wenns nicht geht, ssh1. Welches Protokoll verwendet wird, hängt also davon ab, welcher der beiden Rechner die Initiative ergreift. Ich würde Dir raten bei heinz auch auf 2,1 umzustellen und dsa Passwörter zu genereieren, dann sollte die Sache laufen. -- Machs gut | http://www.iivs.de/schwinde/buerger/tremmel/ | http://packman.links2linux.de/ Manfred | http://www.knightsoft-net.de
participants (3)
-
Dieter Kluenter
-
Ingo Rößler
-
Manfred Tremmel