跳至內容

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

已提問 2 年前檢視次數 488 次

2 個答案
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

專家

已回答 2 年前

專家

已審閱 2 年前

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

已回答 2 年前

專家

已審閱 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。