SSH Connectivity

I am trying to setup a password less connection from a Linux server to Window server and will be using a script to scp a file without using password.

Linux Server (source)

servername : testlinux
id : testbatch

Windows Server (Target)
servername : testwin
id : testwinlogin

I copied the pub key under the testbatch .ssh2 directory to the windows server and put it there under the C:\Users\testwinlogin\.ssh2 and created the authorization file as well.

I was also do a passwordless ssh connection

But this is going to C:\Users\testbatch when i trype ssh testwin

I want to use ssh testwinlogin@testwin and it should go to C:\Users\testwinlogin. How to make it this way ?

did you try this from testlinux?

cat .ssh/id_rsa.pub | ssh b@B 'cat >> .ssh/authorized_keys'

regards...

This is the usual and expected behaviour as it sends the issuing user as the target user.

What happens if you run this command?

When i try to ssh its asking for password and when i give the password its working fine.But i want a passwordless connection

So what's the difference between user "testbatch" and user "testwinlogin" on the target machine? Do they share the same .ssh/authorized_keys file? And, afaik that should be .ssh/, not .ssh2/.

OK sounds like you want the userID to default to testwinlogin on your windws box to do this add the following entries to .ssh/config under testbatch home directory on the linux box (testlinux):

host testwin
user testwinlogin