Windows and Ubuntu transfer files via SSH

Source: Internet
Author: User

    1. Ubuntu installation SSH
sudo apt-get install Openssh-server

2. start the Shh service

Sudo/etc/init.d/ssh start

3.ssh common commands

    • Downloading files from the server
SCP [Email protected]:/path/filename/var/www/local_dir (Local directory)

For example SCP [email protected]:/var/www/test.txt to download/var/www/test.txt files on 192.168.0.101 to/var/www/local_dir (local directory)

    • Uploading local files to the server
scp/path/filename [Email Protected]:/path   

For example scp/var/www/test.php [email protected]:/var/www/the test.php file in the native/var/www/directory to 192.168.0.101 directory on this server

    • Download the entire directory from the server
scp-r [Email protected]:/var/www/remote_dir/(remote directory)/var/www/local_dir (local directory)

Example: scp-r [email protected]:/var/www/test/var/www/

    • Upload directory to server
SCP-  R local_dir [email protected]:remote_dir

For example: scp-r test [email protected]:/var/www/upload the test directory under the current directory to the/var/www/directory of the server

  

Windows and Ubuntu transfer files via SSH

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.