Re: connexion ssh sans mot de passe

Startseite

Nachricht beantworten
Autor: Hugues Levasseur
Datum:  
To: guilde
Betreff: Re: connexion ssh sans mot de passe
root@Dig:/home/hugues# ssh -v admin@192.168.0.46
OpenSSH_7.2p2 Ubuntu-4ubuntu1, OpenSSL 1.0.2g-fips 1 Mar 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to 192.168.0.46 [192.168.0.46] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: identity file /root/.ssh/id_dsa type 2
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu1
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.0
debug1: match: OpenSSH_7.0 pat OpenSSH* compat 0x04000000
debug1: Authenticating to 192.168.0.46:22 as 'admin'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256@???
debug1: kex: host key algorithm: ssh-rsa
debug1: kex: server->client cipher: chacha20-poly1305@??? MAC:
<implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@??? MAC:
<implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ssh-rsa SHA256:wI2zViUW92BUF9yz53Z6Cdy3RGcs641+JufrqncK04k
debug1: Host '192.168.0.46' is known and matches the RSA host key.
debug1: Found key in /root/.ssh/known_hosts:3
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS received
debug1: Skipping ssh-dss key /root/.ssh/id_dsa - not in PubkeyAcceptedKeyTypes
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Trying private key: /root/.ssh/id_rsa
debug1: Trying private key: /root/.ssh/id_ecdsa
debug1: Trying private key: /root/.ssh/id_ed25519
debug1: Next authentication method: keyboard-interactive
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: password
admin@192.168.0.46's password:

Pas sur de bien comprendre ce qui ne vas pas
Sur le nas :

[/] # ll /root/.ssh
lrwxrwxrwx    1 admin    administ        15 May 26 10:32 /root/.ssh -> 
/etc/config/ssh/
[/] # ll /root/.ssh/
drwxr-xr-x    2 admin    administ      4.0k Jun  7 11:15 ./
drwxr-xr-x   26 admin    administ      4.0k Jun  7 03:00 ../
-rw-------    1 admin    administ      1.2k Jun  7 15:11 authorized_keys
lrwxrwxrwx    1 admin    administ        16 May 25 14:53 id_rsa -> ssh_host_rsa_key
lrwxrwxrwx    1 admin    administ        20 May 25 14:53 id_rsa.pub -> 
ssh_host_rsa_key.pub
-rw-------    1 admin    administ       668 May 25 14:52 ssh_host_dsa_key
-rw-r--r--    1 admin    administ       600 May 25 14:52 ssh_host_dsa_key.pub
-rw-------    1 admin    administ      1.6k May 25 14:50 ssh_host_rsa_key
-rw-r--r--    1 admin    administ       397 May 25 14:50 ssh_host_rsa_key.pub
-rw-r--r--    1 admin    administ      3.0k May 26 10:32 sshd_config



Le 07/06/2016 15:40, David Beniamine a écrit :
> On Tue, Jun 07, 2016 at 03:31:54PM +0200, piti wrote:
>> On Tue, Jun 07, 2016 at 03:19:24PM +0200, Hugues Levasseur wrote:
>>> Bonjour la guilde,
>>>
>>> C'est - encore - moi.
>>>
>>> Problème du jour : se connecter en ssh (pour faire un rsync) entre un PC
>>> Ubuntu et un NAS QNap
>>>
>>> Sur le PC :
>>> sudo su
>>> ssh-keygen -t dsa -b 1024
>>>      (Je ne met pas de passphrase)
>>> ssh-copy-id -i /root/.ssh/id_dsa.pub admin@192.168.0.46

>>>
>>> Tout vas bien, mais quand j'essaye de me connecter au NAS avec
>>> ssh admin@192.168.0.46
>>>
>>> ... il me demande mon mot de passe.
>>> (la connexion fonctionne)
>>>
>>> J'ai oublié une étape ?
>> Indiquer quelle clé utiliser ?
>>
>>> ssh -i /root/.ssh/id_dsa admin@192.168.0.46
> ssh devrait chercher cette clef toute seule, c'est un nom parfaitement
> standard, peut être qu'un ssh -v admin@192.168.0.46 pourrait aider a
> comprendre pourquoi il ne le fait pas.