Bonjour,
Ces 2 commandes fonctionnent:
scp /tmp/test kmc@127.0.0.1:/tmp/test_copied
scp -v root@unServerRemote:/tmp/test kmc@127.0.0.1:/tmp/
Mais pas celle là:
kmc@kmcs:~$ scp -v root@unServerRemote:/tmp/test kmc@127.0.0.1:/tmp/
Executing: /usr/bin/ssh ‘-x’ ‘-oClearAllForwardings=yes’ ‘-n’ ‘-v’ ‘-l’ ‘root’ ‘–’ ‘unServerRemote’ ‘scp -v’ ‘/tmp/test’ 'kmc@127.0.0.1:/tmp/'
OpenSSH_7.4p1 Debian-10+deb9u2, OpenSSL 1.0.2l 25 May 2017
debug1: Reading configuration data /home/kmc/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to unServerRemote [adr.ip.remote.server] port 22.
debug1: Connection established.
debug1: identity file /home/kmc/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /home/kmc/.ssh/id_rsa-cert type -1
debug1: identity file /home/kmc/.ssh/id_dsa type 2
debug1: key_load_public: No such file or directory
debug1: identity file /home/kmc/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/kmc/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/kmc/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/kmc/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/kmc/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.4p1 Debian-10+deb9u2
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.7p1
debug1: match: OpenSSH_6.7p1 pat OpenSSH* compat 0x04000000
debug1: Authenticating to unServerRemote:22 as 'root’
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256@libssh.org
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:w3eG1yb0N0uvsRgc/0rUxEL36LdS8BptvDy7UOqL3UI
debug1: Host ‘unServerRemote’ is known and matches the ECDSA host key.
debug1: Found key in /home/kmc/.ssh/known_hosts:2
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/kmc/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password
debug1: Offering DSA public key: /home/kmc/.ssh/id_dsa
debug1: Server accepts key: pkalg ssh-dss blen 434
debug1: Authentication succeeded (publickey).
Authenticated to unServerRemote ([adr.ip.remote.server]:22).
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: pledge: network
debug1: Sending environment.
debug1: Sending env LANG = fr_FR.UTF-8
debug1: Sending command: scp -v /tmp/test kmc@127.0.0.1:/tmp/
Executing: program /usr/bin/ssh host 127.0.0.1, user kmc, command scp -v -t /tmp/
OpenSSH_6.7p1 Debian-5+deb8u3, OpenSSL 1.0.1t 3 May 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to 127.0.0.1 [127.0.0.1] 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: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0
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_6.7p1 Debian-5+deb8u3
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.7p1
debug1: match: OpenSSH_6.7p1 pat OpenSSH* compat 0x04000000
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr umac-64-etm@openssh.com none
debug1: kex: client->server aes128-ctr umac-64-etm@openssh.com none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ECDSA 6a:16:c7:6d:78:0a:ef:54:b5:b7:db:1b:52:f4:25:99
debug1: read_passphrase: can’t open /dev/tty: No such device or address
Host key verification failed.
lost connection
debug1: channel 0: free: client-session, nchannels 1
Transferred: sent 3264, received 4736 bytes, in 0.2 seconds
Bytes per second: sent 15815.2, received 22947.5
debug1: Exit status 1
Je ne comprends pas (entre autre) pourquoi il va chercher l’identity file sur /root/.ssh
alors que je mentionne kmc comme utilisateur. Il n’est pas possible d’utilisateurs différents dans un scp ?