Jump to content

Can not login in AWS putty...


mstdmstdd

Recommended Posts

  Hello!

I read here http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/putty.html 
How To start a PuTTY session.
From My AWS installation I have Instance ID and Public DNS (IPv4)).


But I failed to login using putty. I do :

1) Registering at AWC I downloaded and saved next pem file.
http://imgur.com/a/62kWU

2) As I have no puttygen in my kubuntu 16 so I created in puttygen under windows new ppk file like
http://imgur.com/a/0DR6c


3) Opening putty in hostname field I enter Public DNS (IPv4)) in hostname field
http://imgur.com/a/VejGE

4) and selecting file from 2)
http://imgur.com/a/uolpI


5) and clicking “Open” I got error
http://imgur.com/a/EZYxh

Was step 2) wrong (or what had I to enter there)? How to fix it?

Thanks!

Link to comment
Share on other sites

Putty on windows allows the username and host name to be combined, not sure if it's different on linux. Since the error shows the root@ bit it looks like it probably isn't interpreting it as separate components so yea, try it without the username.

Link to comment
Share on other sites

username - is it "root"/"ubuntu" as I reads in aws docs ? Or that value from aws registration ?

Depends how the AMI was built. IIRC the official Canonical images use "ubuntu" as the user.

 

Also I have ssh command in my console. Is it better to use it? If yes how ? Please, give hints how to start...

Putty is basically just a fancy GUI around ssh. If you like Putty then use it. If you want to use ssh then use that.

 

For ssh the command looks like

$ ssh -i /path/to/key.pem username@host
Note that's a PEM-encoded key. Putty uses PPK format. They are not the same; Putty has a converter tool you can use.

 

Since typing that out is annoying, I personally use an alias in the bashrc/whatever file:

$ alias shh = ssh -i /path/to/key-that-I-use-for-all-instances.pem
$ shh username@host
Link to comment
Share on other sites

  Thank you,
I logged in ssh and made update of system using commands :
 

sudo apt-get update

sudo apt-get upgrade

I read in docs :
 

sudo yum install -y httpd24 php70 mysql56-server php70-mysqlnd

 


I have no yum and seems packets are different, as I got:

$ sudo apt-get install -y httpd php
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package httpd is a virtual package provided by:
nginx-naxsi 1.4.6-1ubuntu3.7
nginx-light 1.4.6-1ubuntu3.7
nginx-full 1.4.6-1ubuntu3.7
nginx-extras 1.4.6-1ubuntu3.7
bozohttpd 20111118-1+deb7u1build0.14.04.1
apache2-mpm-itk 2.4.7-1ubuntu4.13
nginx-core 1.4.6-1ubuntu3.7
apache2-mpm-worker 2.4.7-1ubuntu4.13
apache2-mpm-prefork 2.4.7-1ubuntu4.13
apache2-mpm-event 2.4.7-1ubuntu4.13
apache2-bin 2.4.7-1ubuntu4.13
yaws 1.98-2
webfs 1.21+ds1-9
tntnet 2.2.1-1
ocsigenserver 2.2.0-3
mini-httpd 1.19-9.3
micro-httpd 20051212-15
lighttpd 1.4.33-1+nmu2ubuntu2
ebhttpd 1:1.0.dfsg.1-4.3
boa 0.94.14rc21-5
aolserver4-daemon 4.5.1-16
aolserver4-core 4.5.1-16
You should explicitly select one to install.

E: Package 'httpd' has no installation candidate
E: Unable to locate package php

Which httpd have I to select and I do not see any php packet at all?

I do not need something especial, just apache2/php7/mysql5.
I want to install demo of my apps for testing, there would be no big traffic.

Thanks!

Link to comment
Share on other sites

I don't know what docs you're reading but this isn't right:

sudo yum install -y httpd24 php70 mysql56-server php70-mysqlnd
Ubuntu's Apache and PHP packages are not named like that, plus it prefers apt over yum or dpkg.

 

Also looks like you're using Trusty? It's a bit old now and is limited to PHP 5. You need Xenial.

Link to comment
Share on other sites

yes, Looks like that is really old version :

$ uname -a 
Linux ip-172-31-18-55 3.13.0-110-generic #157-Ubuntu SMP Mon Feb 20 11:54:05 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
ubuntu@ip-172-31-18-55:~$ lsb_release -d; uname -r; uname -i
Description:    Ubuntu 14.04.5 LTS
3.13.0-110-generic
x86_64
Link to comment
Share on other sites

 In list of my instances there 2 items
http://imgur.com/a/xwEuc

and the second is later Kubuntu 16. First instance was 14 suppose, I remember that I created 2 instances.


in ssh I got :

$ ssh -i /home/serge/UbuntuWithLamp.pem ubuntu@ec2-54-201-141-175.us-west-2.compute.amazonaws.com
ssh: Could not resolve hostname \357\273\277ec2-54-201-141-175.us-west-2.compute.amazonaws.com: Name or service not known
serge@serge-at-home:/_wwwroot/wprods$ ssh -i /home/serge/UbuntuWithLamp.pem ec2-54-201-141-175.us-west-2.compute.amazonaws.com
Permission denied (publickey).

Which access I lack? Must be it be other pem file and how to create it for this instance with ubuntu16?

But I logged to the system under putty using ppk file
and see that it is ubuntu16
http://imgur.com/a/Wrvg0


?

Link to comment
Share on other sites

You seem to have a knack for copying and pasting stuff without actually knowing what you're doing.

 

$ ssh -i /home/serge/UbuntuWithLamp.pem ubuntu@ec2-54-201-141-175.us-west-2.compute.amazonaws.com
ssh: Could not resolve hostname \357\273\277ec2-54-201-141-175.us-west-2.compute.amazonaws.com: Name or service not known
Does the hostname "\357\273\277ec2-54-201-141-175.us-west-2.compute.amazonaws.com" look correct to you? I don't know what you did but it doesn't look right to me.

$ ssh -i /home/serge/UbuntuWithLamp.pem ec2-54-201-141-175.us-west-2.compute.amazonaws.com
Permission denied (publickey).
It was able to find the host this time, however it didn't like your credentials. It could possibly, possibly, have something to do with the fact that you didn't have the username in there.
Link to comment
Share on other sites

  Thank you for help!
I created new instance with selecting pem file for it and has access to it ok.

What Next ?


Actually registering on AWS I got this link from AWS support
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/install-LAMP.html

I found this article
https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-16-04

and try to make it by steps. I come to text :


You can do a spot check right away to verify that everything went as
planned by visiting your server's public IP address in your web browser
(see the note under the next heading to find out what your public IP address is if you do not have this information already):

http://your_server_IP_address

 

I run all commands above in this article(includiong firewell commands)

But I stuck on my IP?

I tried to run in browser
https://ec2-54-190-48-33.us-west-2.compute.amazonaws.com/
http://ec2-54-190-48-33.us-west-2.compute.amazonaws.com/
ec2-54-190-48-33.us-west-2.compute.amazonaws.com/

but nothing opened in my browser. Which is the right ip?

Link to comment
Share on other sites

All of those are the same.

 

"Firewall commands?" Unless those commands involve the AWS CLI that's the wrong firewall: you need to edit the instance's security group to allow you to connect to it over HTTP. There will already be an exception for SSH.

Be sure to only allow your IP address.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.