Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

share|improve this question

migrated from stackoverflow.com Apr 15 '11 at 3:46

This question came from our site for professional and enthusiast programmers.

    
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 Apr 15 '11 at 5:25
add comment

2 Answers

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

share|improve this answer
    
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 Apr 15 '11 at 4:10
    
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. –  sparks Apr 15 '11 at 11:38
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.