Not able to connect Ubuntu server 24.0 using winSCP

0

Hi All, Using the private key, we are not able to connect Ubuntu server 24.0 using winSCP with user id ubuntu. can anyone help on this on priority? Thanks

asked 3 months ago104 views
2 Answers
1

Hi,

The default TCP port of (Win)SCP is 22. You must start by verifying that your Ubuntu server is reachable on port 22 from the Windows machine.

For this purpose, I strongly recommend to connect to port 22 of the server via telnet to see if the link gets established or not. To do that, please, follow https://netbeez.net/blog/telnet-to-test-connectivity-to-tcp/

If this connection attempt is successful, then connect to your server via EC2 Connect to validate the proper config of scp. See https://aws.amazon.com/blogs/compute/new-using-amazon-ec2-instance-connect-for-ssh-access-to-your-ec2-instances/ to use Instance Connect.

The proper SCP setup for your server is defined here: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/linux-file-transfer-scp.html

Best,

Didier

profile pictureAWS
EXPERT
answered 3 months ago
profile picture
EXPERT
reviewed 3 months ago
0

I understand you're having trouble connecting to your Ubuntu 24.0 server using WinSCP with the ubuntu user and a private key. This is a common issue that can occur for several reasons. Here are some steps you can take to troubleshoot and potentially resolve the problem:

  1. Verify your security group settings: Ensure that your EC2 instance's security group allows inbound traffic on port 22 (SSH) from your IP address or from anywhere (0.0.0.0/0) if you're not sure of your IP.

  2. Check the instance state: Make sure your EC2 instance is in the "running" state and has passed all status checks in the AWS console.

  3. Confirm the correct private key: Ensure you're using the correct private key (.pem file) that was associated with the instance when it was launched.

  4. Verify the username: For Ubuntu instances, the default username is typically "ubuntu". Double-check that you're using the correct username.

  5. Check key permissions: If you're getting a "Server refused our key" error, ensure that the permissions on your private key file are correct. The key should not be accessible to others.

  6. Review SSH configuration: Check the /etc/ssh/sshd_config file on your instance (if you can access it through the AWS console) to ensure PubKeyAuthentication is set to "yes" and that the correct AuthorizedKeysFile is specified.

  7. Try EC2 Instance Connect: As an alternative, you can attempt to connect using AWS EC2 Instance Connect through the AWS Management Console. This can help determine if the issue is with your local setup or the instance itself.

  8. Restart SSH service: If possible, try restarting the SSH service on the instance.

  9. Check system logs: If you can access the system logs through the AWS console, look for any error messages related to SSH connections.

If you've tried these steps and are still unable to connect, you may need to contact AWS support for further assistance. They can provide more detailed diagnostics based on your specific instance configuration.
Sources
connect to my aws ubuntu from my desktop | AWS re:Post
Not able to connect : Putty, winscp and jenkins | AWS re:Post
Troubleshoot issues connecting to your Amazon EC2 Linux instance - Amazon Elastic Compute Cloud

profile picture
answered 3 months ago
profile pictureAWS
EXPERT
reviewed 3 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions