December 05, 2017

Difference between "SFTP" and "SCP"

❑ SFTP(SSH File Tranfer Protocol)
❍ TCP 22 is default(run on SSH. No FTP service port).
❍ File transfers and file/directory managements are available.
* To resume transmission is possible.
❍ File transfer is relatively slower than SCP.
❍ sftp -P 2222 root@192.168.1.2 : Connect to the 192.168.1.2 server as root.
* get /tmp/myCode.c /root/test : Download myCode.c to local's /root/test.
* put /root/test/myCode.c /tmp : Upload myCode.c to server's /tmp.


❑ SCP(Secure Copy)
❍ TCP 22 is default(run on SSH).
❍ Only file transfers are available.
* To resume transmission is impossible.
❍ File transfer is relatively faster than SFTP.
❍ scp -P 2222 root@192.168.1.2:/tmp/myCode.c /root/ : Connect to the 192.168.1.2 server as root and download the file myCode.c to /root folder of local.
* Uploading can be done by repositioning the two parameters.