Secure Shell (or Secure Socket Shell), abbreviated as SSL, is a network protocol that enables a client to connect to a remote client or a server using a text-based interface. After an SSL connection is made, the client can manipulate the server (or the remote client) by entering commands through the client.
The prerequisites to establish an SSL connection:
1. An SSH Client (from where the user can access the remote server or another client)
2. An SSH Server on the remote machine
3. The IP Address or the name of the remote server
1. Accessing A Remote Server:
To connect to a remote server in Linux, the command ssh is typed followed by the IP address of the remote server.
The name of the remote server can also be used.
2. Specifying the Username to Access a Remote Server:
To connect to a remote server, the username of that remote server can also be used.
3. Changing the Port for SSH Connection:
A port is an endpoint where a process is sent once it reaches the remote server. By default, the SSH command runs at Port 22. To connect through a different port in Linux, the -p option of the SSH command is used.
4. Generating SSH Keys:
To improve security, SSH uses a key-pair, one is a public key, and the other is a private key. The public key is shared with the other clients whereas the private key is kept confidential. SSH key-pairs are used to authenticate clients to servers without the use of passwords, thus giving more security.
To generate the key-pair, the following command is used:
Example:-
5. Copy Files Remotely through SSH:
Files can be copied remotely and securely through the SCP command of SSH. The basic syntax of the command is:
Example:-
6. Restarting the SSH Session:
To restart an SSH session, one of the 2 commands is used based on the Linux distribution being used:
OR
7. Commands in SSH:
The commands in SSH are the same as the ones used in the local computer. The only difference is here, these commands work on the files and directories.
i) ls - This command lists the files in the working directory of the remote machine.
ii) cd- To navigate through the remote machine, the cd command is used.
iii) cp - To copy a file from a source directory to destination directory, the cp command is used. The cp command can only copy and paste files inside the remote machine.
iv) mv - To move a file from one directory to another, the mv command is used. This command also works in the remote machine only.
v) mkdir - This command is USD to create a new directory in the remote machine.
vi) rm - This command is used to remove a file (or directory) from the remote machine.
vii) ifconfig - To see the networking information and the status of the network adapters of the remote machine, the ifconfig command is used.
8. Running a Command on the Remote Machine through the Local Computer using SSH:
To run a command on the remote machine through the local computer, the command is appended to the SSH command as follows:
9. SSH Options
The SSH command comes with a wide range of options. A summary of these options is-
Name | Views | Likes |
---|---|---|
Usermod command in Linux | 5140 | 1 |
SSH Command In Linux | 834 | 7 |
Introduction to Named Pipes | 1201 | 3 |
Linux KILL Command | 2910 | 5 |
Soft Link and Hard Link In Linux | 441 | 2 |
Vi Editor in Linux | 670 | 6 |
FDisk Command in Linux | 568 | 5 |
How to view the History in Linux | 473 | 2 |
Process Manipulation in Linux | 1795 | 4 |
Export command in Linux | 428 | 1 |
ID command in Linux | 428 | 1 |
Netstat Command in Linux | 663 | 3 |
Chmod Command in Linux | 452 | 1 |
Compressing Files in Linux | 363 | 1 |
Crontab in Linux | 486 | 1 |
File Manipulation in Linux | 636 | 5 |
Curl Command in Linux | 529 | 1 |
Env Command in Linux | 410 | 5 |
LSOF Command in Linux | 426 | 1 |
User Manual in Linux | 452 | 1 |
Whereis command in Linux | 452 | 1 |
4 Lesser Known Commands in Linux | 485 | 6 |
Shell Scripting in Linux | 660 | 4 |
Alias command in Linux | 388 | 1 |
How to Kill a Process using Command Line | 495 | 3 |
Comments
Ezee
17-Mar-2022 03:44:59 PMHi, I%u2019m sending a directory of size 13G to other servers using the SCP command. it is copying more than 36G and get No Space left on the device error.
can you please let me know how that is possible and please visit us: https://www.ezeelogin.com