Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSH to AWS Instance without key pairs

1: Is there a way to log in to an AWS instance without using key pairs? I want to set up a couple of sites/users on a single instance. However, I don't want to give out key pairs for clients to log in.

2: What's the easiest way to set up hosting sites/users in 1 AWS instance with different domains pointing to separate directories?

like image 803
Andres Avatar asked May 25 '11 05:05

Andres


People also ask

Can I launch EC2 instance without key pair?

The option Proceed without key pair is used when: When the sshd in your AMI is configured to use password based authentication and no ssh key is needed to access the machine.


2 Answers

Answer to Question 1

Here's what I did on a Ubuntu EC2:

A) Login as root using the keypairs

B) Setup the necessary users and their passwords with

# sudo adduser USERNAME # sudo passwd USERNAME 

C) Edit /etc/ssh/sshd_config setting

For a valid user to login with no key

PasswordAuthentication yes

Also want root to login also with no key

PermitRootLogin yes

D) Restart the ssh daemon with

# sudo service ssh restart 

just change ssh to sshd if you are using centOS

Now you can login into your ec2 instance without key pairs.

like image 130
illy Avatar answered Sep 21 '22 06:09

illy


1) You should be able to change the ssh configuration (on Ubuntu this is typically in /etc/ssh or /etc/sshd) and re-enable password logins.

2) There's nothing really AWS specific about this - Apache can handle VHOSTS (virtual hosts) out-of-the-box - allowing you to specify that a certain domain is served from a certain directory. I'd Google that for more info on the specifics.

like image 23
Chris Bunch Avatar answered Sep 18 '22 06:09

Chris Bunch