Jump to content

Recommended Posts

Posted

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

Posted

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.

Posted
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

Posted

how are you logging in?

ssh-copy-id -i ~/.ssh/mykey user@host

Login

 

ssh -i ~/.ssh/mykey user@host
Posted
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

Posted
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

Posted
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?

Posted
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

Posted
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

 

Posted

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.

  • Upvote 1
Posted

ask ChatGPT this question... how  to setup SSH key-based authentication between 2 linux machines..

Posted
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

Posted
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 

Posted
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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...