jefferson1 Posted March 23 Report Posted March 23 ssh-copy-id ipaddress , Doing this on ubuntu. the result says keys is added to the authorized keys section sucessfully but when i do ssh ipaddress, its asking for password. Where is the issue? I have enabled PasswordAuthentication to yes in the sshd_config file. @kumar4world Quote
erragulabi Posted March 23 Report Posted March 23 did u go n check on the end node to see key is present in authorized keys file? if ues, try to do,export ANSIBLE_HOST_KEY_CHECKING=False. This may not be the issue, but give it a try. Quote
jefferson1 Posted March 23 Author Report Posted March 23 3 minutes ago, erragulabi said: did u go n check on the end node to see key is present in authorized keys file? if ues, try to do,export ANSIBLE_HOST_KEY_CHECKING=False. This may not be the issue, but give it a try. i checked the keys is there, every time i run the copy command a new id is copied i changed .ssh directory permission to 700 and authorixed to 600 i tried your above suggestion also , same response Quote
kathiramdasu Posted March 23 Report Posted March 23 how are you logging in? ssh-copy-id -i ~/.ssh/mykey user@host Login ssh -i ~/.ssh/mykey user@host Quote
jefferson1 Posted March 23 Author Report Posted March 23 10 minutes ago, kathiramdasu said: how are you logging in? ssh-copy-id -i ~/.ssh/mykey user@host Login ssh -i ~/.ssh/mykey user@host firs ssh-copy-id ip address, i get sucessfull message than when i do ssh ipaddr , its asking me to enter password i am doing this on AWS ec2 ubuntu instance Quote
RPGPulka Posted March 23 Report Posted March 23 1 hour ago, jefferson1 said: ssh-copy-id ipaddress , Doing this on ubuntu. the result says keys is added to the authorized keys section sucessfully but when i do ssh ipaddress, its asking for password. Where is the issue? I have enabled PasswordAuthentication to yes in the sshd_config file. @kumar4world you need to enable the password token and refresh it after one hour to login Quote
jefferson1 Posted March 23 Author Report Posted March 23 2 hours ago, RPGPulka said: you need to enable the password token and refresh it after one hour to login where is the password token located, which file? Quote
RPGPulka Posted March 24 Report Posted March 24 3 hours ago, jefferson1 said: where is the password token located, which file? auntentication file and it generates a password valid for 1 day . You can configure the password to expire after 1st authentication or reuse or expire in every 15 min or 1 hour or 24 hours Quote
vithanda_vadhi Posted March 24 Report Posted March 24 6 hours ago, jefferson1 said: firs ssh-copy-id ip address, i get sucessfull message than when i do ssh ipaddr , its asking me to enter password i am doing this on AWS ec2 ubuntu instance Have you checked whether your public key is copied to ~/.ssh/authorized_keys on the server? Is private key authentication enabled on server? Check in /etc/ssh/sshd_config RSAAuthentication yes PubkeyAuthentication yes AuthorizedKeysFile /.ssh/authorized_keys try the ssh with verbose mode (ssh -v) on server check /var/log/secure for more info Quote
erragulabi Posted March 24 Report Posted March 24 instead of using copy ssh command, can do it manually. Generate a key and copy it to target node to authorised key file and try. 1 Quote
Joker_007 Posted March 24 Report Posted March 24 ask ChatGPT this question... how to setup SSH key-based authentication between 2 linux machines.. Quote
jpismahatma Posted March 24 Report Posted March 24 Restart sshd after modifying sshd_config file Quote
jefferson1 Posted March 24 Author Report Posted March 24 12 hours ago, erragulabi said: instead of using copy ssh command, can do it manually. Generate a key and copy it to target node to authorised key file and try. I did that and same issue 3 hours ago, jpismahatma said: Restart sshd after modifying sshd_config file restart of sshd has been removed from linux (ubuntu) its something diff now Quote
jpismahatma Posted March 24 Report Posted March 24 3 hours ago, jefferson1 said: I did that and same issue restart of sshd has been removed from linux (ubuntu) its something diff now Anna config file update chesaka restart corresponding service. Have done passwordless configuration between tower and machines many times Quote
jefferson1 Posted March 24 Author Report Posted March 24 1 hour ago, jpismahatma said: Anna config file update chesaka restart corresponding service. Have done passwordless configuration between tower and machines many times this is what i get, let me what iam doing wrong root@Ubuntu-Managed-Node:~# service ssh restart root@Ubuntu-Managed-Node:~# service sshd restart Failed to restart sshd.service: Unit sshd.service not found. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.