- 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
sshcommand 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>-lattribute 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.pubPrivate Key: /home/bob/.ssh/id_rsa -
To generate a keypair on the
Clientrun 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
Bobcan 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