1

I am trying to SSH to EC2 from a Windows machine. After installing the CYGWIN (SSH enabled), I tried running the following command:

ssh -i /cygdrive/c/cygwin64/home/user/.ssh/user-pc.pem ec2-user@ec2-xx-xxx-xxx-xxx.compute-1.amazonaws.com

Which returns

Pseudo-terminal will not be allocated because stdin is not a terminal.

I have also tried changing to directory to /home/user/.ssh and run the command from there after modifying the path to the .pem file accordingly. However, I get the same result.

What can I do to fix this?

1

Try running ssh with the -t option, like this:

ssh -t -i /cygdrive/c/cygwin64/home/user/.ssh/user-pc.pem ec2-user@ec2-xx-xxx-xxx-xxx.compute-1.amazonaws.com

By adding the -t option you are telling ssh force the creation of a pseudo-terminal even if it would not normally create one.

0

What ended up working for me was reinstalling the Cygwin while making sure that all components of SSH are added during the installation. In addition, I had to 'cd' into the directory with the .pem file and run the command from there.

  • why not convert the pem file amazon issues to a putty-compatible key file and just use putty? or do you need other features that cygwin can provide (X11 forwarding/server ,etc)? docs.aws.amazon.com/AWSEC2/latest/UserGuide/putty.html – ivanivan Dec 10 '16 at 20:01
  • @ivanivan I am trying to avoid dispersing my attention on different software. if it can be solved with something you already have. For some reason, I never liked PuTTY. Call it a hang-up or something like that but that has been the case. – MadPhysicist Dec 10 '16 at 20:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.