SCP Errors

nc: invalid option -- 'X'

You are trying to send file via scp

scp file user@192.168.56.117:/home/user/

And get the following error

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

It can be confusing, because you are not using netcat

But if you run the same command with vvv options (Verbose) you can see the details

scp -vvv file user@192.168.56.117:/home/user/

Executing: program /usr/bin/ssh host 192.168.56.117, user user, command scp -v -t /home/user/ 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/user/.ssh/bastion_key type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/user/.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

Article author: Andrei Olegovich

Related articles
Linux
Debian
Ubuntu
CentOS
Rocky
Bash
Network Configuration
Files
Examine Free Disk Space
Mount Disks and Flash Drives
Combine .pdf Files
diff: Compare Files
find: Search for Files
kill: Finish Process
rename
make
signal: System Signals
env: Environmental Variables
localectl: langugae
systemctl: List of Active Services
Firewall
SCP: File Exchange
SSH: Remote Access
cron: Tasks in Timetable
sudo
Monitoring
C
C++

Search this site

Channel @aofeed Chat @aofeedchat

Contacts and cooperation:
I recommend our hosting beget.com
Write to info@aredel.com if you:
1. Want to write an article for our site or translate an article into your native language.
2. Want to place thematically relevant ads on the site.
3. Ads on my site pass maximum censorship. If you see an ad block unsuitable for school-age children, shocking or misleading - please contact us by e-mail
4. Found a mistake, inaccuracy, bug, etc. on the site. ... .......
5. Articles can be shared on social media by clicking a network icon: