The Systems People Inc.

The Systems People Inc.

Customer Focused Service since 1993

Log into AWS instance using password authentication

By default SSHD in linux instances in AWS are started with password authentication set to NO. For good resaons. Clear text password authentication is NOT as secured.

However for development instances or sandboxes, it might provide a "convenience" that may be worth.

To enable password authentication to AWS linux instances, modify parameter PasswordAuthentication  parameter in file sshd_config and then restart the sshd process.

For example...

root@domU-12-31-39-00-7C-94:[/etc/ssh]
$ pwd
/etc/ssh
root@domU-12-31-39-00-7C-94:[/etc/ssh]
$
$ vi sshd_config

In the VI editor...

# To disable tunneled clear text passwords, change to no here!
PasswordAuthentication yes # <<<< we enabled this!!!!
#PermitEmptyPasswords no
# Changed to no per AWS
#PasswordAuthentication no

Now restart SSHD process.

$ sshd
sshd re-exec requires execution with an absolute path
root@domU-12-31-39-00-7C-94:[/etc/ssh]
$ which sshd
/usr/sbin/sshd
root@domU-12-31-39-00-7C-94:[/etc/ssh]
$
root@domU-12-31-39-00-7C-94:[/etc/ssh]
$ service /usr/sbin/sshd restart
/usr/sbin/sshd: unrecognized service
root@domU-12-31-39-00-7C-94:[/etc/ssh]
$ service sshd restart
Stopping sshd:                                             [  OK  ]
Starting sshd:                                             [  OK  ]
root@domU-12-31-39-00-7C-94:[/etc/ssh]
$

Now SSHD process is started with password authentication enabled. If we remove the key from the putty profle and open a telnet connection, we'll be prompted for userid and password.

We should be able use a valid linux user with password to login.

login as: oracle
oracle@ec2-23-22-205-159.compute-1.amazonaws.com's password:
oracle@domU-12-31-39-00-7C-94:[/home/oracle]
$
oracle@domU-12-31-39-00-7C-94:[/home/oracle]
$
oracle@domU-12-31-39-00-7C-94:[/home/oracle]
$

That's it. Be careful when using this technique.

 Blog Stats

  • Total posts(18)
  • Total comments(0)

Forgot your password?