- Take me to the Tutorial
- In this lecture we will learn about SSH and SCP commands.
- SSH is used to login to the remote computer.
- SCP is used to copy of files/directories within the file system also can copy data to remote computer.
-
To login to the remote server use
ssh
command with hostname or IP address.ssh <hostname OR IP Address>
-
To login to the remote server with specific username and password.
ssh <user>@<hostname OR IP Address>
-l
attribute can also be used asssh –l <user> <hostname OR IP Address>
-
Passwordless authentication can be setup via key-pair authentication in order to login to the remote server with password.
-
Public and Private key are stored at below location.
Public Key: /home/bob/.ssh/id_rsa.pub
Private Key: /home/bob/.ssh/id_rsa
-
To generate a keypair on the
Client
run this commandbob@caleston-lp10 ~]$ ssh-keygen –t rsa
-
To copy the Public key from the client to the remote server
bob@caleston-lp10 ~]$ ssh-copy-id bob@devapp01
-
Now
Bob
can login to remote server without password[bob@caleston-lp10 ~]$ ssh devapp01
-
Public Key is copied to the remote server at :
[bob@caleston-lp10 ~]$ cat /home/bob/.ssh/authorized_keys