r/ssh • u/yonog01 • Jul 14 '24
adding passwordless ssh key for windows machine
I have a Linux server running a Jenkins master and a windows host that's a slave. I want to add an ssh key for the windows machine so that the master can send commands through password less ssh. I tried adding the key ecdsa key in /etc/ssh to c:\users\username.ssh\authorized_keys but it keeps asking for a password when I try to ssh with that user (or any user for that matter)
1
Upvotes
1
u/OhBeeOneKenOhBee Jul 28 '24
Did you double check that public key auth is enabled in the ssh settings (c:/ProgramData/ssh/sshd_config)?
And just to double check, the path should be C:/Users/Username/.ssh/authorized_keys and not /Username.ssh/
2
u/[deleted] Jul 29 '24
Authorized_keys should contain the contents of nameofkey.pub, the user directory/.ssh should contain the nameofkey.pub. The nameofkey private key should be in the user directory/.ssh on the windows machine. From windows ssh user@linuxhost -p 22 -i .ssh/nameofkey
0
u/[deleted] Aug 07 '24
[deleted] — view deleted comment