An Overview & Hands-On to Connect (SSH) into a Linux Server (ubuntu flavor) with Putty from a windows11 Local Machine
Focus:
- Tailored for SRE, DevOps, Cloud, and DevSecOps Engineers
Breakdown:
- Intro,
- Prerequisites (If twtech don't have PuTTY)
- Connect using PuTTY,
- Using SSH Keys for More Secure Access (Recommended),
- Project-Hands-On.
Intro:
- To connect to an Ubuntu server from Windows 11 using PuTTY, you need the server's IP address or hostname, and login credentials (username and password, or an SSH key).
Here are the steps:
Part 1:
Prerequisites (If twtech don't have PuTTY)
- Download PuTTY: Open a web browser on twtech Windows 11 machine and download the PuTTY application from the official PuTTY website.
- Install: Run the installer file and follow the prompts to install the application.
Part 2:
Connect using PuTTY
- Open PuTTY: Launch the PuTTY application from your Start Menu.
- Enter Connection Details: In the "Session" category on the left, you will see the configuration options:
- Host Name (or Server IP address): Enter the Server IP address or the hostname of twtech Ubuntu server.
- Port: Ensure this is set to the default SSH port, which is
22. - Connection type: Select
SSH.
- Save the Session (Optional): In the "Saved Sessions" box, type a name for this connection (e.g., "twtechUbuntuServer") and click Save. This lets you double-click the name next time to load all settings automatically.
- Connect: Click the Open button at the bottom of the window.
- Security Alert (First Time Only):
- If this is the first time connecting to this server, PuTTY will display a security alert asking twtech to confirm the server's host key.
- Click Accept to trust the server and proceed.
- Log In:
- A terminal window will open, prompting twtech for a username:
login as:. - Enter twtech Ubuntu username (e.g.,
ubuntuor twtech custom username) and press Enter.
- A terminal window will open, prompting twtech for a username:
- It will then prompt for a password.
- Type twtech password and press Enter.
- The cursor will not move or show characters as twtech types the password; this is a standard security feature.
- Once authenticated, twtech will be logged into the Linux server's command line interface.
Part 3:
Using SSH Keys for More Secure Access (Recommended)
- For better security, use SSH keys instead of passwords. This involves generating a pair of keys (a private key and a public key) and uploading the public key to your Ubuntu server.
- Generate Keys: Use the
puttygen.exetool (installed alongside PuTTY) to create an SSH key pair. Save the private key (.ppkfile) on twtech Windows machine. - Upload Public Key: Copy the contents of the public key generated by PuTTYgen into twtech user's
~/.ssh/authorized_keysfile on the Ubuntu server. - Configure PuTTY:
- In the PuTTY configuration window, go to Connection > SSH > Auth (or Credentials in newer versions).
- Click Browse... and select the private key file (
.ppk) twtech saved. - Go back to the Session screen, select twtech saved session name, and click Save to store this configuration.
- Connect with Key: When twtech connects, PuTTY will automatically use the private key for authentication, often skipping the password prompt entirely (unless twtech sets a passphrase on its private key).
Project: Hands-On
- How twtech Connects (SSH) into EC2 Instance with Putty from a Windows11 Local Machine.
Step-1:
- Provision a Server (EC2 Instance,
Step-2:
- twtech downloads and install
putty open-source tool to the windows machine (windows11).
- Go to the link: https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html
- Select the: 64bitx86 windows installer:
- Putty package downloaded
Step-3:
- Go to download folder in the windows11 local machine and run the setup.installer
- Confirm and install Putty:
Step-5:
- Right-click on puTTY and sent to the desktop for easier access.
- Right-click on puTTYgen and
sent to the desktop for easier access.
Step-6:
Go to desktop to verify if the shortcuts were sent successfully:
- Click open puTTYgen:
- Generate the .ppk key format from here
Step-7:
- Upload the key.pem to convert to .pkk format
- Select all file from dropdown menu
of file categories to
select the key.pem and open the file.
- Save it as private key:
- Confirm to save private key.
Step-8:
- To Use putty to ssh into the instance,
- Go
to desktop and open putty app.
Step-9:
- Copy the public IP address of Server(twtech-db-server)we want to ssh into (connect)
- Configure the PublicIP and assign a saved sessions (twtech-EC2 Instance)
- Click on saved sessions: twtech-EC2
Instance
NB:
- We still need to authenticate user login and configure the path to ssh-key (twtec-puttykey.ppk)
- (close (X) this windows)
Step-11:
- Go back to puTTy and click on saved session: twtech-EC2 Instance starts to Load
- Add the hostname (ubuntu, ec2-user) to the PubIPaddress to authenticate user login: and save configurations again.
Step-12:
- twtech adds the private key converted (twtech-puttykey.ppk) to putty.
- Click on ssh
- Then: Auth,
- then Browser Location where twtech-puttykey.ppk Credentials is created and stored.
- Select the private key (
twtech-puttykey.ppk) and upload.
- Go back to session: save
configuration.
- Open putty to access the
instance (
twtech-db-server)
No comments:
Post a Comment