I want to automate copying with scp
. If I use the default ssh port, the URI will look like:
scp://root@host:/root/ids/rules.tar.gz
But I changed my ssh port to 3131
. How can I fetch and append the ssh port to the scp command?
Beginning with version 7.7, The commonly-used scp
command-line utility accepts URL as a command-line argument. The common way to specify a port number in a URL is following the hostname:
scp://root@host:3131/root/ids/rules.tar.gz
^^^^
Alternately, scp
has a -P
option to specify a port:
scp -P 3131 root@host:/root/ids/rules.tar.gz .
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With