Showing posts with label SSH. Show all posts
Showing posts with label SSH. Show all posts

Wednesday, 26 October 2022

How do I stop WinSCP inactive? | How do you fix WinSCP inactive? | How to keep SSH connections alive?

🌟 Stay Updated with Tech Tips!

Join the Ram N Java community for more expert tutorials and fixes.

SUBSCRIBE TO OUR CHANNEL

How to Fix WinSCP Connection Timeout Issues

If you've ever been in the middle of a task only to find your WinSCP connection has timed out, you know how frustrating it can be. This common issue happens when the server closes the connection due to inactivity. Fortunately, there is a simple "Keep-Alive" fix!

Step 1: Open Your Session Settings

Start WinSCP and find the session you want to modify in the login dialog. Instead of logging in immediately, click on the Edit button and then select Advanced. This opens the deeper configuration options.

Step 2: Enable Keep-Alive

In the Advanced Site Settings window, navigate to the Connection category on the left-hand menu. Look for the "Keepalives" section. Here, change the setting to "Sending dummy protocol commands" (this is usually the most effective method for SSH/SFTP).

Step 3: Set the Interval

The "Seconds between keepalives" is crucial. Setting this to something like 30 or 60 seconds is generally perfect. This tells WinSCP to send a tiny bit of data to the server periodically, essentially whispering "I'm still here!" so the server doesn't hang up on you.

Step 4: Save and Connect

Click OK to close the advanced settings, and then click Save on the main login screen to ensure these changes are permanent for that session. Now, when you connect, your session should stay active as long as you need it!

Why does this happen? Many servers have a security setting called 'ClientAliveInterval' that automatically cuts off idle users. These steps help bypass that limit safely.


Explore More from Ram N Java

Friday, 6 May 2022

How to Connect to an EC2 instance on AWS via SSH? | SpringBoot-Deploying to AWS EC2 Instance

🚀 Mastering the Cloud?

Join the Ram N Java community for high-quality AWS and Spring Boot tutorials!

SUBSCRIBE TO THE CHANNEL

Introduction

Connecting to an Amazon EC2 instance via SSH is a critical skill for any developer or DevOps engineer. Whether you're deploying a Spring Boot application or managing a server, SSH allows you to securely access your Linux machine from anywhere. In this guide, we'll walk through the entire process using an intermediate Linux machine and a .pem key file.

Step 1: Prepare Your Key File (.pem)

When you first launch an EC2 instance, AWS provides a .pem file (private key). You must have this file to authenticate your connection. If you are using a Linux machine to jump into another EC2 instance, follow these steps:

  • Open WinSCP or any file transfer tool.
  • Upload your .pem file to the Linux machine you are currently logged into.
  • Verify the file exists by running the ls command in your terminal.

Step 2: Secure Your Key File

SSH requires that your private key file is not publicly viewable. If the permissions are too open, the connection will be rejected. Run the following command to set the correct permissions:

chmod 400 your-key-file.pem

Step 3: Get Connection Details from AWS

To connect, you need the Public DNS or IP address of your instance:

  1. Go to the AWS EC2 Console.
  2. Select your running instance and click Connect.
  3. Under the SSH Client tab, copy the example command provided by AWS.

Step 4: Execute the SSH Command

Using the details from AWS, run the SSH command in your terminal. The structure looks like this:

ssh -i "your-key-file.pem" ec2-user@your-public-dns-name

Once you hit Enter, you'll be securely logged into your Amazon EC2 instance!

Conclusion

Congratulations! You've successfully connected to your AWS EC2 instance via SSH. This foundation allows you to install software, manage files, and deploy applications like Spring Boot with ease. Remember to keep your .pem files secure and never share them publicly!

How to Connect to an EC2 instance on AWS using PUTTY? | SpringBoot-Deploying to AWS EC2 Instance

🚀 Master Cloud Deployment!

Want more AWS and Spring Boot tutorials? Subscribe to Ram N Java today!

SUBSCRIBE ON YOUTUBE

Introduction

Connecting to an Amazon EC2 instance from a Windows machine typically requires a tool called PuTTY. Since AWS provides private keys in .pem format and PuTTY uses .ppk, you'll also need the PuTTY Key Generator (PuTTYgen). In this guide, we'll walk through the entire conversion and connection process.

Step 1: Install PuTTY and PuTTYgen

Download the PuTTY installer for Windows from the official website. This installer usually includes both the PuTTY client and PuTTYgen. Complete the installation before proceeding to the next step.

Step 2: Convert .pem to .ppk using PuTTYgen

AWS gives you a .pem file, but PuTTY needs a .ppk file. Here is how to convert it:

  1. Open PuTTYgen.
  2. Click Load and select your .pem file (ensure "All Files" is selected in the file browser).
  3. Once loaded, click Save private key.
  4. Give it a name and save it as a .ppk file.

Step 3: Get Your EC2 Connection Details

Log in to your AWS Console and go to the EC2 Dashboard:

  • Ensure your instance is Running.
  • Copy the Public IPv4 address or Public IPv4 DNS.
  • Note the default username (usually ec2-user for Amazon Linux).

Step 4: Configure the PuTTY Connection

  1. Open PuTTY.
  2. In the Host Name field, paste your IP address or DNS.
  3. Go to Connection > Data and enter your username (e.g., ec2-user) in the "Auto-login username" field.
  4. Go to Connection > SSH > Auth, click Browse, and select your .ppk file.
  5. Go back to Session, give it a name (like "My-EC2"), and click Save.

Step 5: Connect and Verify

Click Open. If a security alert pops up, click "Yes." You should now be logged into your AWS EC2 terminal!

Pro Tip: Remember that stopping and starting your instance changes its Public IP address unless you are using an Elastic IP!

Conclusion

You have successfully configured PuTTY to access your AWS environment. This setup is the gateway to deploying applications, managing databases, and exploring the power of the cloud. Stay tuned for more tutorials on Spring Boot deployment!

Tutorials