Created 08-18-2016 07:02 AM
how to create password less ssh between 2 AWS EC2 instances.
Created 08-18-2016 07:05 PM
Subash is correct. It is not that different.
Pre-reqs:
1. access to your EC2 machine and using the pem key or credentials with root permissions.
2. already setup RSA keys on your local machine. Private key and public key are available at "~/.ssh/id_rsa" and "~/.ssh/id_rsa.pub", respectively.
Steps:
useradd -m <yourname> sudo su <yourname> cd mkdir -p ~/.ssh touch ~/.ssh/authorized_keys
Append contents of file ~/.ssh/id_rsa.pub on you local machine to ~/.ssh/authorized_keys on EC2 machine.
chmod -R 700 ~/.ssh chmod 600 ~/.ssh/*
service sshd restart # On Centos service ssh restart # On Ubuntu
ssh -A <yourname>@ec2-xx-xx-xxx-xxx.ap-southeast-1.compute.amazonaws.com
/etc/sudoers
. Make sure following two lines are uncommented:## Allows people in group wheel to run all commands %wheel ALL=(ALL) ALL ## Same thing without a password %wheel ALL=(ALL) NOPASSWD: ALL
Add yourself to wheel group.
usermod -aG wheel <yourname>
Try it and let me know.
Created 08-18-2016 07:46 AM
I assuming both are linux servers.
Please folllow the steps in mentioned url: http://www.tecmint.com/ssh-passwordless-login-using-ssh-keygen-in-5-easy-steps/
Created 08-18-2016 08:10 AM
Hi @subhash parise i know how to create password less ssh in linux. but i dont kown how to create password less ssh in ec2 instances.
Created 08-18-2016 08:13 AM
same mechanism will apply ec2 instances also 🙂
Created 08-18-2016 07:05 PM
Subash is correct. It is not that different.
Pre-reqs:
1. access to your EC2 machine and using the pem key or credentials with root permissions.
2. already setup RSA keys on your local machine. Private key and public key are available at "~/.ssh/id_rsa" and "~/.ssh/id_rsa.pub", respectively.
Steps:
useradd -m <yourname> sudo su <yourname> cd mkdir -p ~/.ssh touch ~/.ssh/authorized_keys
Append contents of file ~/.ssh/id_rsa.pub on you local machine to ~/.ssh/authorized_keys on EC2 machine.
chmod -R 700 ~/.ssh chmod 600 ~/.ssh/*
service sshd restart # On Centos service ssh restart # On Ubuntu
ssh -A <yourname>@ec2-xx-xx-xxx-xxx.ap-southeast-1.compute.amazonaws.com
/etc/sudoers
. Make sure following two lines are uncommented:## Allows people in group wheel to run all commands %wheel ALL=(ALL) ALL ## Same thing without a password %wheel ALL=(ALL) NOPASSWD: ALL
Add yourself to wheel group.
usermod -aG wheel <yourname>
Try it and let me know.
Created 02-20-2017 06:28 AM
Kishore.. enable the below parameter under /etc/ssh/sshd_config
# To disable tunneled clear text passwords, change to no here!
PasswordAuthentication yes
and add the hostnames under /etc/hosts.. then follow the regular ssh procedure.
,Hi Kishore,
to create password less ssh, first enable "authenticationpassword yes" option under /etc/ssh/sshd_config. add hostnames under /etc/hosts . then follow the regular ssh procedure. first check the ping is working from one instance to other or not?
Created 07-26-2017 01:25 PM
Hi how can i do the same with a local system running Windows?
Created 07-26-2017 03:08 PM
Created 07-28-2017 07:33 AM
Thanks @Jay SenSharma. I used this document but I can't achieve what I want to do : setup password-less SSH between my EC2 instances running RHEL7 from my local machine running Windows. I've open a new thread (here) to give more details.
Created 11-18-2017 11:11 PM
This is probably the best link which I have found on how to setup the passwordless login using ssh-copy-id command on ec-2 instances.
https://superuser.com/questions/331167/why-cant-i-ssh-copy-id-to-an-ec2-instance
Probably, this might help.