Enable SSH putty access for ubuntu

  • This topic is empty.
  • Post
    Weekend Wiki
    Keymaster
    To enable SSH access to an Ubuntu machine using PuTTY, follow these steps:


    Step 1: Install SSH Server on Ubuntu

    1. Open Terminal on your Ubuntu machine.
    2. Run the following commands to update the package list and install the SSH server:
      sudo apt update
      sudo apt install openssh-server -y
      
    3. Check the SSH service status to ensure it’s running:
      sudo systemctl status ssh
      
      • If it’s not running, start and enable it:
        sudo systemctl start ssh
        sudo systemctl enable ssh
        

    Step 2: Get the Ubuntu Machine’s IP Address

    1. Use the following command to find the IP address of your Ubuntu machine:
      ip a
      

      Look for the IP address associated with your network interface (e.g., eth0 or wlan0).


    Step 3: Configure Firewall (if applicable)

    1. If you are using ufw (Uncomplicated Firewall), allow SSH through the firewall:
      sudo ufw allow ssh
      sudo ufw enable
      

      Verify the rules:

      sudo ufw status
      

    Step 4: Download and Configure PuTTY

    1. Download PuTTY from the official website.
    2. Open PuTTY and configure the session:
      • Host Name (or IP Address): Enter the Ubuntu machine’s IP address.
      • Port: Ensure it is 22 (default SSH port).
      • Connection Type: Select SSH.
    3. Save the session configuration for future use.

    Step 5: Connect to Ubuntu Using PuTTY

    1. Click Open in PuTTY.
    2. A terminal window will open. If prompted with a security alert about the server’s host key, click Yes.
    3. Log in using your Ubuntu username and password.

    Optional: Configure SSH for Enhanced Security

    1. Edit the SSH configuration file:
      sudo nano /etc/ssh/sshd_config
      
    2. To improve security:
      • Disable root login: Change PermitRootLogin yes to PermitRootLogin no.
      • Allow specific users: Add AllowUsers yourusername.
      • Change the default SSH port: Modify Port 22 to a custom port, e.g., Port 2222.
    3. Restart the SSH service:
      sudo systemctl restart ssh
      

    Now you should be able to access your Ubuntu machine securely using PuTTY!

    If still you’re not able to do so, connect with us at [email protected]

  • You must be logged in to reply to this topic.
en_USEnglish