Ошибки SCP
nc: invalid option -- 'X'
Вы пытаетесь отправить файл по scp
scp file andrei@192.168.56.117:/home/andrei/
И получаете ошибку
nc: invalid option -- 'X' Ncat: Try `--help' or man(1) ncat for more information, usage options and help. QUITTING. ssh_exchange_identification: Connection closed by remote host lost connection
Если вы начинающий пользователь, вас может удивить это сообщение - причём здесь вообще
netcat
Однако, если выполнить ту же команду с опциями vvv (Verbose - то есть подробный вывод логов)
scp -vvv file andrei@192.168.56.117:/home/andrei/
Executing: program /usr/bin/ssh host 192.168.56.117, user andrei, command scp -v -t /home/andrei/ OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 58: Applying options for * debug1: /etc/ssh/ssh_config line 70: Applying options for * debug1: Executing proxy command: exec nc -X connect -x 192.168.56.103:1080 192.168.56.117 22 debug1: key_load_public: No such file or directory debug1: identity file /home/andrei/.ssh/bastion_key type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/andrei/.ssh/bastion_key-cert type -1 debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_7.4 debug1: permanently_drop_suid: 1000 nc: invalid option -- 'X' Ncat: Try `--help' or man(1) ncat for more information, usage options and help. QUITTING. ssh_exchange_identification: Connection closed by remote host lost connection
Permission denied (publickey,gssapi-keyex,gssapi-with-mic)
ec2-user@35.217.211.103: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
Попробуйте явно указать ключ