Gangmax Blog

自由之思想,独立之精神

Copy Files Remotely via SCP

| Comments

Use the following commands to check/start/stop ssh service on the target computer(from here):

1
2
3
sudo service ssh status
sudo service ssh stop # It will be stopped until manually restarted again (will not restart after a reboot)
sudo service ssh start

On the destination computer, make sure you have “scp” command available and run the following command to copy files to the target computer for example:

1
2
scp -pr /home/duser/下载/work tuser@target_computer_ip:/home/tuser/下载
# "p" means reserving the file attributes, "r" means copying recursively.

And also, you can copy multiple files in one command like below(from here):

1
scp root@10.247.103.124:/cisco-sim/bin/\{endrc,aliasrc,exitrc,configrc,zonesetrc,show.sh,memberrc,zonerc,norc\} .

Comments