The `ssh` command in Linux stands for Secure Shell and is used for establishing a secure remote connection between two computers. It encrypts data during transmission, making it ideal for tasks like remote login, file transfers, and executing commands on distant servers.
Examples of SSH Commands:
ssh username@host.example.com
Connects to a remote server using the specified username and host
ssh user@example.com 'ls -l'
Runs the `ls -l` command on the remote server, listing files in long format.
ssh -i ~/.ssh/id_rsa user@host.example.com
Uses an SSH private key for authentication instead of a password.
ssh -L 1234:localhost:80 user@example.com
Creates a secure tunnel, allowing local access to port 80 via localhost:1234.
ssh -p 2222 user@example.com
Connects to the remote server using port 2222 instead of the default 22.
ssh -X user@host.example.com
Enables remote execution of graphical applications on the local display.
The `ssh` command is an essential tool for secure communication in Linux, providing encrypted access to remote systems. Its versatility allows users to perform tasks like remote login, file transfers, and port forwarding, making it indispensable for system administration and remote work environments.