Home Download Ubuntu

Useful copy commands for ssh server

As you know SSH is a secure, encrypted way to make connections to remote hosts or servers. A SSH server accepts connections from SSH aware clients and allows them to log into the system as if they are sitting right in front of it. You can run shell and X based programs remotely using SSH.

1. How to connect into remote ubuntu ssh server:

sudo ssh username@192.168.0.1


- username is the remote user you access
- 192.168.0.1 is the ip of the remote ubuntu machine. If you have a domain name on your ubuntu remote machine, you can replace 192.168.0.1 with the respective domain name (ex. domain.com).

2. How to copy files and folders from a remote ubuntu ssh server into local machine:

sudo scp -r username@192.168.0.1:/home/username/remotefile.txt .


- username is the remote user you access
- 192.168.0.1 is the ip of the remote ubuntu machine
- /home/username/remotefile.txt is the location of the remote file
- . is your current directory. It can be also something like: /home/username/
- -r switch is to copy recursive

3. How to copy files and folders from local machine to remote ubuntu ssh server:

sudo scp -r localfile.txt username@192.168.0.1:/home/username/


- short explanation: copies localfile.txt from local machine into /home/username/ remote ssh server

Resources: Ubuntu.com

0 comments:

Post a Comment