passwordless ssh

1

May be this is a repeat question, but I couldn't find any answer that works for me in the search result.

I am trying to connect to a prod_host from my office_desktop_host which I have connected from windows/putty over VPN on my laptop. Interestingly, when I am in office I can ssh to this prod_host from my office_desktop_host without any passwords

Baically I am trying to run some script, that barfs because it prompts for password and if I press cancel gives me :

ssh_exchange_identification: Connection closed by remote host.

I have changed the hosts.allow on the prod_host to have SHD: ALL [which might be risky but is a diff discussion]

1] How can I do a passwordless ssh and why is it different between the same hosts, when I am on VPN

p101

Posted 2011-04-15T03:42:22.130

Reputation: 151

How are you connecting to office_desktop_host from your laptop over VPN? Are you using RDP/Remote desktop, or perhaps SSH to cygwin? – heavyd – 2011-04-15T05:25:13.303

Answers

1

You need to have your public key file on any machine that you are remoting to. To get this passwordless you either need to have something running like Keychain on OS X or I believe putty has a program called Pageant on windows that offers similar functionality.

Alternatively generate public key files with no pass phrase(not recommended).

sclarson

Posted 2011-04-15T03:42:22.130

Reputation: 246

Thanks sparks for the reply. Why am able to connect when I am in office. In both scenarios I connect form office_desktop_host and production_host . I think its already configured from passwordless aceess, something changes on the VPN/putty. I am able to run this script fine in office. – p101 – 2011-04-15T04:10:57.930

I haven't tried putty to another server before but there is a chance it is using the public key from the original desktop. I've spent too much of my time in rdp the last few years to remember which key gets sent when ssh'ing from an ssh'd machine. – sclarson – 2011-04-15T11:38:23.693

0

PuTTyGen creates an ssh key on the box you are connecting from, the desktop. The public key and the private key reside in a directory: ssh (assuming windows). Leave them there.

On the remote UNIX box for the account you intend to connect to create an .ssh directory in the login directory. The .ssh directory has to be 700 permissions, the login directory 755. Use conventional psftp (or plink) to copy the public key from your destop ssh directory to the remote .ssh directory.

The remote host has a files in /etc: ./ssh/ssh_config ./ssh/sshd_config

These control what access you have and who/how you login.

It sounds to me more like you are using active directory or cifs (samba) to gain access from your desktop office app to the unix box files, which is different from logging in as a user.

jim mcnamara

Posted 2011-04-15T03:42:22.130

Reputation: 769