Home » Questions » Computers [ Ask a new question ]

SSH from Windows to Linux without entering a password

SSH from Windows to Linux without entering a password

I am trying to use ssh/scp from Windows to Linux without having to enter a password.

Asked by: Guest | Views: 78
Total answers/comments: 4
Guest [Entry]

"I used this:

c:\> type c:\users\my_name\.ssh\id_rsa.pub | ssh root@172.110.1.171 ""cat >> ~/.ssh/authorized_keys"""
Guest [Entry]

"I'm assuming your keys are not password protected, and what you're getting is not a request for your key's password.

~/.ssh isn't used by putty on the windows side, and putty doesn't have a default private key setting. If you're using a command line ssh client such as cygwin, creating a .ssh directory off of your home would work. From putty, you'll need to configure and save a session.

From the putty configuration dialog, look at connection -> data, and fill in the auto-login username field. Then go to connection -> ssh -> auth, and set your private key correctly. Then go back to the session dialog, and save this session. You can also set the hostname if you'd like.

Once you have a saved session, you can use 'putty -load ""savedsession""'."
Guest [Entry]

"You may also need to change permissions on your home directory:

chmod 755 ~"
Guest [Entry]

"I was able to do this exactly from Windows 7 by using the -i option for supplying an identity private key:

ssh -i X:\win-path\to\private-key remoteuser@remote.host.com

except that on the remote host, my authorized keys are in /etc/ssh/authorized_keys/remoteuser and in /etc/ssh/sshd_config, I changed

#AuthorizedKeysFile .ssh/authorized_keys
AuthorizedKeysFile /etc/ssh/authorized_keys/%u

but I don't know if the SSH remote config should matter."