Use SSH to transfer files between Ubuntu Server and Ubuntu Desktop

 Ubuntu Server16.04 和 Ubuntu Desktop18.04 

 

 

1. Ubuntu Desktop18.04 client install ssh protocol, client login server to prepare

   sudo  apt-get  install  ssh

 

2. Enter the terminal Server16.04 the Ubuntu the visudo, enter the user privilege specification (specification user rights)  

     xinly ALL = (ALL: ALL)   ALL it on top of the root

 

3. Create a user xinly server provider (Ubuntu Server16.04)

    adduser  xinly

    Password: 111111

 

4. On the client (Ubuntu Desktop18.04), with xinly account login server, ip address of the server is: 192.168.1.19

    ssh  [email protected]

    ************ server password to enter xinly account, as shown below:

5. Under xinly account, create folders ddd

    mkdir  ddd

    Creating a program in c language ddd folder myfirst.c

    vim  myfirst.c  

    Compile and run, as shown below:

6. The client, /ddd/myfirst.c files under xinly account under Ubuntu Server16.04 uploaded to the / home / ubuntuserver directory

    scp  -r  myfirst.c  [email protected]:/home/ubuntuserver

    Prompted to enter the server password: ************

7. back to the server at / home / ubuntuserver file directory can see myfirst.c

 

Guess you like

Origin www.cnblogs.com/duanqibo/p/11205364.html