Basics of SSH
Secure Shell (SSH) is a network protocol that establishes a secure and encrypted connection between two computers over an unsecured network. It is primarily used for secure remote access and management of systems. SSH provides a secure channel for executing commands, transferring files, and accessing services on remote machines. By encrypting the data transmitted over the network, SSH ensures the confidentiality and integrity of information, protecting it from unauthorized access or tampering. SSH typically uses port 22 as the default port for communication, although it can be configured to use different ports if needed. Its widespread usage among system administrators, developers, and IT professionals is attributed to its ability to securely administer remote systems, transfer files securely, and enable secure communication, making it an essential tool for secure and reliable remote system management.
SSH using a PC and PuTTY Client
Learn how to establish a connection using PuTTY
Step 1: Launch PuTTY
- Launch PuTTY from the Start menu or desktop shortcut.
Step 2: Configure the SSH Session
- In the PuTTY Configuration window, enter the hostname or IP address of the SSH server in the "Host Name (or IP address)" field.
- Make sure the "Connection type" is set to "SSH".
Step 3: Configure the key authentication.
- In the left panel, expand the "SSH" category and select "Auth" (underneath "SSH").
- Click on the "Browse" button next to the "Private key file for authentication" field.
- Navigate to the location where you saved the private key file, select it, and click on the "Open" button.
Step 4: Save the Session Settings
- In the left panel, click on the "Session" category (at the top).
- Enter a name for your session in the "Saved Sessions" field (e.g., "My SSH Session").
- Click on the "Save" button to save the session settings.
Step 5: Connect to the SSH server
- Click on the "Open" button to initiate the SSH connection.
- If you set a passphrase for your private key, you will be prompted to enter it.
- If everything is set up correctly, you should be connected to the SSH server using your key file.
How to SSH using a Mac w/ Terminal
Learn how to establish a connection using the mac terminal
Step 1: Launch the Terminal
- Open the Terminal application on your Mac. You can find it by navigating to "Applications" -> "Utilities" -> "Terminal". This is where you'll enter the SSH commands.
Step 2: Locate your SSH Key File
- Make sure you have the SSH key file (usually with a .pem or .ppk extension) saved on your Mac. If you don't have one, you'll need to generate an SSH key pair using a tool like ssh-keygen or PuTTYgen.
Step 3: Set Appropriate Permissions for your Key File
- By default, SSH requires that the permissions on the private key file are restricted. You can ensure this by running the following command in the Terminal:
chmod 400 /path/to/your/private_key.pem
- Replace /path/to/your/private_key.pem with the actual path to your key file.
Step 4: Connect to the Remove Server
- To establish an SSH connection using the key file, use the following command in the Terminal:
ssh -i /path/to/your/private_key.pem username@server_ip_address
- Replace /path/to/your/private_key.pem with the actual path to your key file, username with your username on the remote server, and server_ip_address with the IP address or domain name of the remote server.
- Example:
ssh -i ~/.ssh/my_key.pem john@example.com
Step 5: Confirm the Connection
- If everything is set up correctly, you'll be prompted to confirm the connection by typing "yes" and pressing Enter. This is a security measure to ensure you're connecting to the correct server.
Step 6: You're Connected!
- You can now use the Terminal to execute commands on the remote server.