How to use SSH command line in Centos 8

techouse

SSH command line

Is there any difference between Centos 7, Cento8 and Ubuntu SSH commands. Let’s find out

SSH in Centos 8

In Linux,

The most common way to get a shell prompt on a remote system is to use (SSH) Secure Shell.
Most of the Linux systems (including centos, Red Hat Enterprise Linux) and macOS provide the OpenSSH
command-line program ssh for this purpose. While in others such as ubuntu we need to install it by running command.

apt-get install openssh-server

Now, Let us try to connect machine with user(chirag) through shell using ssh command using password



[email protected]:~$ ssh [email protected]

The ssh command encrypts the connection to secure the communication

Now, let us try to connect machine with user(chirag) without password but through public key.

An alternative way to authenticate to a remote machine without entering a
password is through public key authentication.



In new cloud instances (aws, azure, google cloud) do not allow users to use a password to log in with
ssh for tighter security. Following command can help you to connect your machine using public key.

Suppose we have private key as chirag.pem which is provided by instance, now check the permission for the private key ie. 700

-rwx—— 1 chirag chirag 1696 Feb 11 19:00 chirag.pem

use below command to provide 700 permission to public key

[email protected]:~/.ssh$ chmod 700 chirag.pem

The maching public key to aur private key is already exist on the machine

ssh -i chirag.pem [email protected]_address_machine

To logout from the machine

[[email protected] ~]$ exit

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.