Not able to transfer files using between server A and B

Hi All,

I have generated public and private pair to avoid to enter password manually while sending files through sftp.

But still I am facing issues and every-time prompt asking enter password.

Below are steps I fallowed to make ssh connection between two servers.

  1. Generated public and private key pair
  2. Given permission on .ssh directory and on both keys
  3. Copied public key in target server and setup permission to 700
  4. Tried to login using ssh from source server to target server using below command. And it's returned to Target server
    ssh id@host
  5. After step i exit from target server and tried to login using sftp

After completion step-5 it's still asking to enter password while connecting the server.

Can someone please help me to resolve this issue.

Regards,
Renu

You don't want 700 on your keys, you want 700 on the directory. The keys should have 600.

Where (which path) did you copy it to? Which permissions did you set? Why 700?

Do I read that you can connect interactively to the server?

Try the sftp with multiple -v (verbose) options and post the log.

Hi Corona688 and Rudic, Thanks for your response, after changed permission on keys folder connection established between both servers.

But now I am not able to use cd in my script.

Error cd:0403-010 A specified flag is not a valid for this command.

Command I am using after connection established sftp is cd /path but it's not working.
Can you please help on this resolve this?

Regards,
Renu

Without seeing your code, I have no idea why its doing that.

Please show your code.

Hi Corona, Thanks for the response.

Now code is working fine after put << EOF in below line.

sftp user@xx.xx.xx.xx << EOF.

1 Like