Workshop-linux day 4

Hello everyone !!!! I am prathmesh ingawale Here is the blog about the 4th day of Linux workshop conducted by Pranav Jambare sir.

SSH :

. SSH stands for Secure Shell Protocol.

. The SSH command provides a secure encrypted connection between two hosts over an insecure network.

. There are two types of SSH keys:

1 . Public key : Which can be shared with everyone.

2 . Private key: Which cannot be shared with anyone.

. syntax:ssh [username]@[IPaddress]

There are two important packages for creation of SSH connections:

.openssh-client

.openssh-server

This command is used to create a hidden directory.

Syntax:-vi /root/.ssh/known_host

This command is used to delete a public key.

Syntax:-vi /etc/ssh/sshd_config

This command is used to open the ssh configuration file.

Syntax:-vi /etc/host.allow

This command is used to allow the network to connect to a specific client.

Syntax:-vi /etc/host.deny

This command is used to deny the network to a specific client.

Locate:

The "locate" command allows you to quickly find files and directories based on their names. It relies on a pre-built database called "locatedb," which needs to be updated periodically. To search for files or directories using "locate," follow these steps:

Step 1: Update the "locatedb" database by running the following command as the root user or with sudo privileges:

COPY

sudo updatedb

Step 2: Once the database is updated, you can use the "locate" command to search for files. For example, to find all files and directories named "example.txt" in the entire system, you can run:

COPY

locate example.txt

Note that the "locate" command searches for files and directories based on their names, so it's generally faster than "find" but may not give real-time results if the database is not up to date.

Both "find" and "locate" have numerous options and can be customized to suit your specific search requirements. You can refer to their respective manual pages ("man find" and "man locate") for more information on their usage and available options.

Passwordless SSH:

Passwordless SSH in Linux refers to the ability to log into a remote server or computer without entering a password each time. It involves setting up a secure way to authenticate using SSH keys instead of passwords.

Normally, when you log into a remote computer using SSH, you have to enter your password every time. With passwordless SSH, you generate a special key pair (a public key and a private key) on your local computer.

We actually place the public key on the remote server.

When we try to connect, the server recognizes our public key and allows us to log in without needing to type our password.

The command

Syntax-

ssh -keygen

generates public/private rsa key pair.

The command

Syntax-

cat id rsa

shows the private key.

The command

Syntax-

ssh -copy -id i id -rsb.pub root@168.1.5

establishes a connection.

Thank you!!!

#learnwithpra9