Loading .pem onto puttygen error - amazon-web-services

I'm trying to setup my AWS for an ubuntu VM. For this with putty, I'm using puttygen to get .ppk file from .pem (from AWS) and then I got an error message as shown below.
The environment is Windows 10. I actually tried this process on another Windows device and everything worked fine but not on mine. I assume that my laptop has some trouble with recognizing .pem file. Anyone has any better idea?
Thanks

PuTTYgen, Release 0.73, Build platform: 64-bit x86 Windows
.Per file need to:
1. Encoding should be UTF-8 (not UTF-8 BOM or something else)
2. Check end of file symbols, need to be Windows CR LF
3. After "-----END RSA PRIVATE KEY-----" need to have an empty line

Related

Problem connecting via SSH from Windows to AWS Linux Instance [Permission denied; (publickey,gssapi-keyex,gssapi-with-mic)]

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:

Key not present on Coral Dev Board when configuring MDT with macOS host machine

I am currently following the Coral Dev Board configuration guide using a MacOS machine running Catalina as my host machine. As per the instructions, for me to use the MDT command line tools on my specific host machine I must manually configure mdt. I used the following guide step-by-step but end up with the following error when I try to connect to the board.
Waiting for a device...
Connecting to jumbo-goose at 192.168.0.78
Key not present on jumbo-goose -- pushing
It looks like you're trying to connect to a device that isn't connected
to your workstation via USB and doesn't have the SSH key this MDT generated.
To connect with `mdt shell` you will need to first connect to your device
ONLY via USB.
Cowardly refusing to attempt to push a key to a public machine.
I would greatly appreciate if someone would be able to assist me in debugging this issue. I have reflashed my device a few times so I am unsure where the issue is emerging.
On the Coral Dev Mini I had similar issues with generating ssh keys, especially when I switched from a Windows to Linux machine. The easiest was (though not as secure) is to follow these steps and allows ssh with a password. First you will need to connect with a USB cable.
https://serverpilot.io/docs/how-to-enable-ssh-password-authentication/
To edit use sudo nano /etc/ssh/sshd_config
The key is to set: PasswordAuthentication yes
Check the sha25sum of the key file transferred to the dev board is the same as on MacOS, mine didn't match i.e the cut and paste wasn't quite right. With key file transferred manually using a SD card it worked first time on mdt devices/mdt shell commands.

Is it possible to download file or folders from AWS Linux EC2 instance to local Windows 10 machine?

I am having one Linux Ec2 instance on AWS and my local machine is Windows 10 (64-bit).
I want to download some files or folders from Ec2 to location windows machine.
I am not sure whether it is possible or not? if yes, how we can do that.
thanks.
I tried this it worked for me.
Download https://mobaxterm.mobatek.net/ its an Enhanced terminal for Windows.
You can link your EC2 instance directly via SSH its pretty simple to set up. Just follow the instuctions they've given. Once linked, its super easy to export, import, create files and folders all via mobaxterm.
folders in mobaxterm:
Got the command to Copy from Windows to Linux.
First you need to install putty (putty-64bit-0.74-installer.msi) on your windows machine
The Command is as follow it will copy the folder(e.g. DokerAutomationResult) to the windows machine from AWSLinux machine.
pscp -r ubuntu#xx.xxx.xx.xx:/home/ubuntu/DokerAutomationResult ./
[pscp -r ubuntu#(ipAddress):(locationOfLinuxFileLocation /(locationToCopyInWInodws) ]
For better Understanding:
https://www.youtube.com/watch?v=Sc0f-sxDJy0&ab_channel=Liv4IT
Yes it is possible to download files from ec2 linux instance to local system.
You can use scp -i key user#ip add:/file location which you want to download.
. will download file in your current location on local system

How to fix error by creating new ssh connection?

I m trying to cross-compiling a simple HelloWorld app in C++ on Win 10 for raspberry pi3. I installed toolchain to configure it out. But till now by creating new ssh connection i got always an Error such as "Access denied" or "No connection could be made bcz the target maschine actively refused it".
I checked many tutorials to cross-compiling but no success till now
I think you are mixing different stuff here.
Cross compiling means compiling (and linking) the software for the embedded target on the host computer (in your case Win10). You don't need to SSH on the target for this. You'll likely need to run your configure your build like this:
./configure --host=arm-linux --build=amd64-pc-linux-gnu
The host argument is where the binary should run, and the build argument is where the binary is built.
However, I suspect that you've successfully built the software on your Win10 computer, and then you're trying to copy it on the embedded device. In that case, you must make sure that:
The embedded device is connected to the network
It's running a SSH daemon (likely opensshd)
It's allowing your user to connect to (typically, on default installation, root is not allowed to connect, you'll need to modify /etc/ssh/sshd_config to PermitRootLogin to yes)
(Optionally) You generate a key pair on the host (via ssh-keygen and copy the public key on your embedded user's .ssh/authorized_keys folder) to allow password-less login
Please refer to SSH man page.
With all the above in place, you can then scp build/mySoftware root#myDevice:/usr/local/bin without the Access Denied message.

Can I use my Apple Developer ID signing certificate on a Windows 7 machine?

I used Windows Explorer to "Install Certificate" for my certificate on my Windows 7 build machine. But I could not sign a file:
> signtool sign /a exefile
SignTool Error: No certificates were found that met all the given criteria.
Thinking that signtool needed the p12 file but wasn't saying anything, I then used Windows Explorer in an attempt to "Install PFX" but got an error from the Certificate Import Wizard saying "The Specified file is empty.".
Do I really have to do this whole "obtain a signing certificate" process all over again for each build machine platform type (macOS, Windows, Linux)?
Yes, you can use the certificate so long as you correctly export the cer and p12 files from the macos host and install them correctly on the windows host. I used the macos keychain app to export the certificate two times, once to export the cer file and again to export the p12 file. The reason my first attempt failed is because the p12 I assumed was correct was not at all correct. After I exported correctly, I was able to use windows explorer to double click on the two files and install them.