LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Enterprise (https://www.linuxquestions.org/questions/linux-enterprise-47/)
-   -   How to make a Password-Less Login from Windows to Linux using OpenSSH? (https://www.linuxquestions.org/questions/linux-enterprise-47/how-to-make-a-password-less-login-from-windows-to-linux-using-openssh-4175548881/)

manoj.linux 07-24-2015 11:17 PM

How to make a Password-Less Login from Windows to Linux using OpenSSH?
 
I installed the OpenSSH on my Windows Machine. I want to connect to the remote Linux machine without typing password. I followed the bellow instructions but the SSH needs password to establish the connection yet.
1.Open CMD and run: ssh-keygen -t rsa (The public and private keys are generated in the C:\Users\user.ssh) folder
2.Copy the id_rsa.pub content into /home/kouhi/.ssh/authorized_keys in my Linux remote machine
3.In Linux Machine run: chmod 700 .ssh
4.In Linux Machine run: chmod 644 .ssh/authorized_keys

When I try to Ssh kouhi@remote.com the connection ask me the password yet. Also I tied Ssh -i C:\Users\user.ssh\id_rsa kouhi@remote.com

Also I get the following reply when run the ssh command:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for 'C:\\Users\\user\\id_rsa' are too open.
It is recommended that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: C:\\Users\\user\\id_rsa

Dman58 07-25-2015 12:56 AM

Looks to me as the Server authorization is flagging the clients insecure setup. I would suggest generating another RSA key in a more secure private folder and trying again on the client machine. I'm no expert though.

Ook 07-25-2015 01:15 PM

You want to make sure the .ssh directory is chmod 700. read/write/execute by owner only. Neither group nor others have any access at all.

id_rsa needs to be chmod 600, not 644. That is what it is complaining about, and that is what you need to fix. 644 lets group/others have read access to it. You do not want group or others to have any access to it at all.

So go to your linux box and chmod the id_rsa file to 600.


All times are GMT -5. The time now is 03:21 AM.