I am currently developing a mobile app for iOS and Android using .NET MAUI. I am running Visual Studio 2022 Preview on Windows 10 (Visual Studio Version 17.3.0), so to debug and run an emulator for iOS I need to pair Visual Studio to a Mac (https://learn.microsoft.com/en-us/dotnet/maui/ios/pair-to-mac).
I have an AWS MacOS EC2 Instance on a dedicated host for this (running Monterey 12.4). From my local machine, I can ssh into it using the ".pem" file I received from AWS. I have followed all the relevant instructions to enable remote login on the Mac, and I established a VNC connection so I could verify all the settings in the GUI. I set up a password for the ec2-user profile because Visual Studio requires a username and password to pair to the Mac instead of ssh keys. Every time I try to connect with Visual Studio, I receive an error stating I have incorrect credentials. I have tried:
Changing ssh settings in /etc/ssh/sshd_config. I have set PasswordAuthentication = yes and PermitRootLogin = yes. I have tried setting ChallengeResponseAuthentication = yes or no at different times and have done the same thing for the UsePAM setting. Whenever I have changed settings I've restarted the sshd service using:
sudo launchctl unload /System/Library/LaunchDaemons/ssh.plist
sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist
I have edited the /usr/local/aws/ec2-macos-init/init.toml file to allow password authentication and stop the ec2-user password from being randomized. I don't think this should affect me much though, as this config file (I believe) is only run when the machine is rebooted.
In both of the above attempts, I cannot connect to my instance with Visual Studio, and when I try to connect over ssh without the key file, I receive the error:
Permission Denied (Public Key)
I added ssh keys to the remote server and my local .ssh directory so I can login without specifying the .pem file. I hoped perhaps I could then connect in Visual Studio without a password. I can connect fine from ssh, but still cannot connect with Visual Studio.
None of this has worked. Any suggestions for how to connect to this MacOS EC2 instance with a password instead of a key would be much appreciated. I presume if that works I will be able to connect with Visual Studio.
You need
Edit file /usr/local/aws/ec2-macos-init/init.toml
secureSSHDConfig = false
Edit /etc/ssh/sshd_config.d/050-ec2-macos.conf
PasswordAuthentication yes
ChallengeResponseAuthentication yes
UsePAM yes
Reboot macos
Related
I launched an instance & downloaded my secret key. I've attempted this on 2 different devices and instances. Im trying to connect to the instance so I can upload files. Whenever I attempt to connect, this permission denied message displays.
Note I've downloaded and used openSSH
PS C:\WINDOWS\system32> ssh -i C:\Users*\Downloads*key.pem #ec2----.us-west-2.compute.amazonaws.com
The authenticity of host 'ec2----.us-west-2.compute.amazonaws.com (...)' can't be established.
ECDSA key fingerprint is SHA256:.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'ec2----.us-west-2.compute.amazonaws.com,...' (ECDSA) to the list of known hosts.
*#ec2----**.us-west-2.compute.amazonaws.com: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
PS C:\WINDOWS\system32>
P.S. This is my first post, so constructive criticism on etiquette is welcome :)
Recently started my first job (an internship really) in the IT field. 3 months ago working for a start-up. Im hoping to migrate eventually to something in the field of cloud security, OSINT, DevSecOps, Web Development. Passionate about information security, open source software.
I followed this tutorial from amazon on how to connect to my instance
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/openssh.html
Looks like it's an issue with .pem file permissions. Check this video & see if you can resolve the error.
You can use puttygen to get ppk file which is helpful to SSH from windows.
If you want to use .pem files, mobaxterm is good software to use
You are very welcome to the community, it's nice to know you started your first Job!
To get you started on how to connect to the AWS Linux instance there is a nice KB article Connect to your Linux instance from Windows using Windows Subsystem for Linux and another one using putty look at here & another SO thread.
There are a few thing you need to learn as Prerequisites:
Verify that the instance is ready
Verify the general prerequisites for connecting to your instance
Install the Windows Subsystem for Linux (WSL) and a Linux distribution on your local computer
Copy the private key from Windows to WSL
Then use :
ssh -i /path/key-pair-name.pem instance-user-name#instance-public-dns-name
OR
ssh -i /path/key-pair-name.pem instance-user-name#instance-IPv6-address
From using your Windows CMD:
PS C:\WINDOWS\system32> ssh -i C:\Users\<user_name>\Downloads\testkey.pem ec2-user#ec2----.us-west-2.compute.amazonaws.com
OR
PS C:\WINDOWS\system32> ssh -i C:\Users\<user_name>\Downloads\testkey.pem ec2-user#<Some_IP_Address>
Better Use mobaexterm and copy user key in there and you will there:
I recently installed OpenVPN on my VPS (Centos 7) which runs on a different port(943).
Since then I am not able to access CWP Pro which runs on port(2031).
SSH and other services works perfectly.
Any idea on how i can fix that problem without reinstalling CWP Pro?
Your copy of CWP pro may have expired. Run the update command sh /usr/local/cwpsrv/htdocs/resources/scripts/update_cwp on SSH shell.
You can login as root to change user configuration and change user password to access user accounts at ip_address:2031
I have created the ec2 instance for my education purpose via the link provided from my university.
I have done all the procedures and now can connect to the server from ssh client (i am using xshell).
Now I want to connect to the server from Visual studio code. Everywhere I look on the web, the routine procedure of creating the SSH config file and providing the path of the config file in the VSC's remote development setup for connection is given. I have done all that and I still get a timeout and connection fails. Please help.
Provide ssh command like: ssh hello#21.12.114.12 -A.
And just select a path to save configuration, eg. [HOME]/.ssh/config. It's a local file.
I am building a .net core 2.0 console app on windows 10 but I want to debug it on a remote linux server running debian 9.
I found this article:
https://blogs.msdn.microsoft.com/devops/2017/01/26/debugging-net-core-on-unix-over-ssh/
but where I get stuck is selecting the SSH connection. My remote server has authentication and if I enter the user#ip:port it doesn't find anything.
I found some mention of using SSH tunnelling but as there is no dotnet process listening on the server (it's installed but it doesn't have any listening service running I can see) I am unsure exactly what port I'm meant to be tunnelling or even which direction to tunnel it.
What do I need to do to get my SSH connection visible in the debugger?
I just tried this and I found that the Find.. button doesn't do anything either.
First you enable SSH connections in your Linux host (in my case, Ubuntu, I had to run sudo ufw allow ssh). Test things out by opening cmd on Windows and doing ssh user#host.
Then, on Visual Studio, in the SSH attach to process window, make sure you hit "refresh" and check the "show processes from all users" box. You should see the "dotnet" process running.
EDIT: you should be prompted for the remote host's password at some point. Here's the dialog shown when I changed the password on the remote host and then attempted to debug.
I have set up a jenkins slave server with cygwin and I'm launching builds on it via ssh.
The build of our project succeeds if run locally as the slave user both in the windows command prompt and in the cygwin command prompt. I can also ssh into the machine as the slave user and run the build successfully.
However, when jenkins runs the build as that slave, it fails trying to compile the first C++ project with the error: fatal error C1902: Program database manager mismatch; please check your installation.
Visual C++ 2010 express, and Visual C# 2010 express are both installed and required for our project to build.
In my research I found some indications that cygwin does not handle the remote login correctly here: https://java.net/projects/hudson/lists/users/archive/2008-10/message/130
Has anyone else solved this problem?
Try below solution
Use “Launch slave agents via Java Web Start” to add windows slave to jenkins master.
It will launch Jenkins service on windows machine using some local users account. Then change local user to the user you are using to build locally.
The problem with “Launch slave agents on Unix machines as SSH” method is, it runs connection using “cyg_server” user.