Nach dem ich nun lange rumprobiert habe, wollte ich euch da mal fragen und zwar dreht es sich um folgendes.
Ich möchte mich von server1 auf server2 (nicht meine eigenen Server) per ssh user@ip auf den anderen server verbinden, was auch funktioniert nur aber nicht beim 2. Remote Server.
Es wurde mit ssh-keygen -b 4096 -t rsa ein schlüsselpaar erzeugt.
Dann habe ich auf dem remoteserver ein touch authorized_keys gemacht und dann die datei mit joe authorized_keys geöffnet.
anschliessend auf dem localen rechner ein cat id_rsa.pub den schlüssel kopiert und auf den remoteserver in die authorized_keys reinkopiert und gespeichert. Die datei authorized_keys hat die Rechte 644 und Ownder web1:ftponly und der Ordner .ssh hat auf beiden Servern chmod 0755 und owner web1:ftponly.
Nachdem der pubkey dort gespeichert ist, möchte ich mich vom localserver via ssh user@ip einloggen, aber der verlangt jedesmal ein Password egal was ich mache.
So nagut sagte ich, dann teste ich das mal mit meinem Server.
Ich packe mein pubkey in dem von dem anderen user seinen lokalen authorized_keys und versuchte per ssh user@ip auf den Server zu connecten, was ohne weiteres gelingt und ohne Password abfrage.
So zurück zu den Servern von dem User und ich versuchte mal von lokal nach lokal mit dem pubkey zu connecten, was auch gelingt ohne Password abfrage. In diesen beiden fällen trägt er beides in die known_hosts ein ohne nach dem PW zu fragen.
Nur von dem User seine Server der Remote da will er immer ein Password haben, obwohl ich die selben Prozeduren vollziehe wie mit meinen eigenen Server oder auch mit dem user seinen loaklen Server.
Er möchte perdu nicht von loakl nach remote ohne password, weil der pubkey wurde auch da eingetragen und will wie gesagt dennoch ein Password haben.
Hier einmal die sshd_configs von server1 (loakl) des users:
Code: Select all
Port 22
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 yes
#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 no
#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 support for the deprecated 'gssapi' authentication
# mechanism to OpenSSH 3.8p1. The newer 'gssapi-with-mic' mechanism is included
# in this release. The use of 'gssapi' is deprecated due to the presence of
# potential man-in-the-middle attacks, which 'gssapi-with-mic' is not susceptible to.
#GSSAPIEnableMITMAttack no
# 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 yes
#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
# This enables accepting locale enviroment variables LC_* LANG, see sshd_config(5).
AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
AcceptEnv LC_IDENTIFICATION LC_ALL
Code: Select all
Port 22
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 yes
#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 no
#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 support for the deprecated 'gssapi' authentication
# mechanism to OpenSSH 3.8p1. The newer 'gssapi-with-mic' mechanism is included
# in this release. The use of 'gssapi' is deprecated due to the presence of
# potential man-in-the-middle attacks, which 'gssapi-with-mic' is not susceptible to.
#GSSAPIEnableMITMAttack no
# 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 yes
#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
server1 (loakl)
Code: Select all
drwx------ 2 web1 ftponly 4096 Nov 20 12:15 .ssh <- habs auch mit 0755 versucht
drwx------ 2 web1 ftponly 4096 Nov 20 12:15 .
dr-xr-x--- 8 web1 www 4096 Nov 19 16:56 ..
-rw------- 1 web1 ftponly 3243 Nov 20 10:52 id_rsa
-rw-r--r-- 1 web1 ftponly 735 Nov 20 10:52 id_rsa.pub
-rw-r--r-- 1 web1 ftponly 222 Nov 20 12:15 known_hosts
Code: Select all
drwxr-xr-x 2 web1 ftponly 4096 Nov 20 12:14 .ssh <- auch mit 0700 versucht.
-rw-r--r-- 1 web1 ftponly 736 Nov 20 12:08 authorized_keys
Wo kann das Problem liegen, das er das Perdu nicht macht?
Weitere infos:
Server1 ist ein Vserver
Server2 normaler rootserver
Auf beiden servern läuft suse 9.3 als OS
Ich habe alle möglichkeiten durch und habe keine Lösung gefunden, warum er bei den server2 immer ein PW will wenn ich per ssh user@ip mich einloggen will, wobei beim vserver alles ohne probleme funktioniert.
Wäre nett, wenn da jemand eine Lösung hätte.