[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

ssh non connette con publickey, solo password



dal client ho provato sia dsa che rsa:
$ ssh-keygen -b 1024 -t dsa -f /home/beppe/.ssh/id_dsa_beppe
scp /home/beppe/.ssh/id_dsa_beppe.pub beppe@192.168.240.100:/home/beppe/.ssh/id_dsa_beppe.pub

$ ssh-keygen -b 2048 -t rsa -f /home/beppe/.ssh/id_rsa_beppe
Generating public/private rsa key pair.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/beppe/.ssh/id_rsa_beppe.
Your public key has been saved in /home/beppe/.ssh/id_rsa_beppe.pub.

$ scp /home/beppe/.ssh/id_rsa_beppe.pub beppe@192.168.240.100:/home/beppe/.ssh/id_rsa_beppe.pub


$ cat /etc/ssh/ssh_config | grep -v -E "^$|^#"
Host *
   SendEnv LANG LC_*
   HashKnownHosts yes
   GSSAPIAuthentication yes
   GSSAPIDelegateCredentials no



dal server:
$ cat id_dsa_beppe.pub > authorized_keys
$ cat id_rsa_beppe.pub >> authorized_keys

$ rm id_*

$ cat /etc/ssh/ssh_config | grep -v -E "^$|^#"
Host *
   SendEnv LANG LC_*
   HashKnownHosts yes
   GSSAPIAuthentication yes
   GSSAPIDelegateCredentials no

$ cat /etc/ssh/sshd_config | grep -v -E "^$|^#"
Port 22
Protocol 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
UsePrivilegeSeparation yes
KeyRegenerationInterval 3600
ServerKeyBits 768
SyslogFacility AUTH
LogLevel INFO
LoginGraceTime 120
PermitRootLogin no
StrictModes yes             # ho provato anche con no
AllowUsers beppe
AllowGroups beppe
PubkeyAuthentication yes
AuthorizedKeysFile      %h/.ssh/authorized_keys
IgnoreRhosts yes
RhostsRSAAuthentication no
HostbasedAuthentication no
IgnoreUserKnownHosts no
PermitEmptyPasswords no
ChallengeResponseAuthentication yes
PasswordAuthentication yes
X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server
UsePAM yes



dal client x connettersi:
$ ssh -i /home/beppe/.ssh/id_dsa_beppe.pub -l beppe 192.168.240.100 -vvv

OpenSSH_4.3p2 Debian-9etch3, OpenSSL 0.9.8c 05 Sep 2006
...
debug1: Connection established.
debug3: Not a RSA1 key file id_dsa_beppe.pub.
debug1: identity file id_dsa_beppe.pub type 2
...
debug1: Miscellaneous failure
No credentials cache found

...
debug3: check_host_in_hostfile: filename /home/beppe/.ssh/known_hosts
debug3: check_host_in_hostfile: match line 1
debug1: Host '192.168.240.100' is known and matches the RSA host key.
debug1: Found key in /home/beppe/.ssh/known_hosts:1
debug2: bits set: 480/1024
debug1: ssh_rsa_verify: signature correct
...
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: id_dsa_beppe.pub (0x8096518)
debug1: Authentications that can continue: publickey,password,keyboard-interactive debug3: start over, passed a different list publickey,password,keyboard-interactive debug3: preferred gssapi-keyex,gssapi-with-mic,gssapi,publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering public key: id_dsa_beppe.pub
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug2: we did not send a packet, disable method
debug3: authmethod_lookup keyboard-interactive
debug3: remaining preferred: password
...


dal client x connettersi con chiave rsa e passphrase:
$ ssh -i /home/beppe/.ssh/id_rsa_beppe.pub -l beppe 192.168.240.100 -vvv

debug3: sign_and_send_pubkey
debug1: PEM_read_PrivateKey failed
debug1: read PEM private key done: type <unknown>
Enter passphrase for key 'id_rsa.pub':
debug1: PEM_read_PrivateKey failed
debug1: read PEM private key done: type <unknown>
debug2: bad passphrase given, try again...

e non riconosce la passphrase messa, serve la password.

Ovviamente le chiavi erano state copiate tutte nel file autorized_keys,
sia da sole che con altre, ma non ha mai funzionato.

qualche suggerimento?

ciao
Beppe

--
le nuvole non hanno regole,
perchè non hanno mai rinunciato
alla libertà di sognare.


Reply to: