Jump to content


Photo

Can not login in AWS putty...


Best Answer requinix, 25 March 2017 - 05:50 PM

Check the Inbound rules to make sure there's something for HTTP (and HTTPS if you need that) for your IP address. Go to the full post


  • Please log in to reply
15 replies to this topic

#1 mstdmstdd

mstdmstdd
  • Members
  • PipPipPip
  • Advanced Member
  • 31 posts

Posted 17 March 2017 - 01:39 PM

  Hello!

I read here http://docs.aws.amaz...uide/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!



#2 requinix

requinix
  • Administrators
  • Forgotten Administrator
  • 8,686 posts
  • LocationWA

Posted 17 March 2017 - 07:52 PM

#3 is wrong.

That field is just the hostname. No username. No @.

Put the username in the Connection > Data (I think) pane.

#3 kicken

kicken
  • Gurus
  • Wiser? Not exactly.
  • 3,225 posts
  • LocationBonita, FL

Posted 18 March 2017 - 12:37 AM

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.
Recycle your old CD's, don't trash them!
Did I help you out? Feeling generous? I accept tips via Bitcoin @ 14mDxaob8Jgdg52scDbvf3uaeR61tB2yC7

#4 Sudhircev

Sudhircev
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 19 March 2017 - 01:49 PM

Have you entered correct IP and Password? Is ssh server installed on source server?



#5 mstdmstdd

mstdmstdd
  • Members
  • PipPipPip
  • Advanced Member
  • 31 posts

Posted 20 March 2017 - 03:35 PM

#3 is wrong.

That field is just the hostname. No username. No @.

Put the username in the Connection > Data (I think) pane.

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



#6 mstdmstdd

mstdmstdd
  • Members
  • PipPipPip
  • Advanced Member
  • 31 posts

Posted 20 March 2017 - 03:42 PM

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



#7 requinix

requinix
  • Administrators
  • Forgotten Administrator
  • 8,686 posts
  • LocationWA

Posted 20 March 2017 - 05:08 PM

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


#8 mstdmstdd

mstdmstdd
  • Members
  • PipPipPip
  • Advanced Member
  • 31 posts

Posted 21 March 2017 - 07:22 AM

  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!



#9 requinix

requinix
  • Administrators
  • Forgotten Administrator
  • 8,686 posts
  • LocationWA

Posted 21 March 2017 - 11:38 AM

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.

#10 mstdmstdd

mstdmstdd
  • Members
  • PipPipPip
  • Advanced Member
  • 31 posts

Posted 21 March 2017 - 12:01 PM

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


#11 mstdmstdd

mstdmstdd
  • Members
  • PipPipPip
  • Advanced Member
  • 31 posts

Posted 21 March 2017 - 12:23 PM

 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


?



#12 requinix

requinix
  • Administrators
  • Forgotten Administrator
  • 8,686 posts
  • LocationWA

Posted 21 March 2017 - 10:59 PM

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.

#13 mstdmstdd

mstdmstdd
  • Members
  • PipPipPip
  • Advanced Member
  • 31 posts

Posted 24 March 2017 - 01:24 PM

  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.amaz...stall-LAMP.html

I found this article
https://www.digitalo...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-4....amazonaws.com/
http://ec2-54-190-48....amazonaws.com/
ec2-54-190-48-33.us-west-2.compute.amazonaws.com/

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



#14 requinix

requinix
  • Administrators
  • Forgotten Administrator
  • 8,686 posts
  • LocationWA

Posted 24 March 2017 - 02:52 PM

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.

#15 mstdmstdd

mstdmstdd
  • Members
  • PipPipPip
  • Advanced Member
  • 31 posts

Posted 25 March 2017 - 04:57 PM

  Do you mean this group?
http://imgur.com/a/v4HnL

Creating new instance in this group I set 1 property - I selected pem file for this group.
Had I to set some more options ?

Can these options be edited now and where ?
http://imgur.com/a/1LFAu
How these properties entintled and where located ?



#16 requinix

requinix
  • Administrators
  • Forgotten Administrator
  • 8,686 posts
  • LocationWA

Posted 25 March 2017 - 05:50 PM   Best Answer

Check the Inbound rules to make sure there's something for HTTP (and HTTPS if you need that) for your IP address.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users