Unix/Linux Go Back    


UNIX for Beginners Questions & Answers If you're not sure where to post a Unix or Linux question, post it here. All unix and Linux beginners welcome in this forum!

Not able to transfer files using between server A and B

UNIX for Beginners Questions & Answers


Reply    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 6 Days Ago   -   Original Discussion by renukeswar
renukeswar's Unix or Linux Image
renukeswar renukeswar is offline
Registered User
 
Join Date: Jan 2017
Last Activity: 8 December 2017, 4:57 AM EST
Posts: 7
Thanks: 0
Thanked 1 Time in 1 Post
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
Sponsored Links
    #2  
Old Unix and Linux 6 Days Ago   -   Original Discussion by renukeswar
Corona688's Unix or Linux Image
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 13 December 2017, 10:16 AM EST
Location: Saskatchewan
Posts: 22,546
Thanks: 1,159
Thanked 4,286 Times in 3,955 Posts
You don't want 700 on your keys, you want 700 on the directory. The keys should have 600.
Sponsored Links
    #3  
Old Unix and Linux 6 Days Ago   -   Original Discussion by renukeswar
RudiC's Unix or Linux Image
RudiC RudiC is offline Forum Staff  
Moderator
 
Join Date: Jul 2012
Last Activity: 13 December 2017, 4:17 PM EST
Location: Aachen, Germany
Posts: 11,797
Thanks: 339
Thanked 3,659 Times in 3,357 Posts
Quote:
Originally Posted by renukeswar View Post
.
.
.
3. Copied public key in target server and setup permission to 700
Where (which path) did you copy it to? Which permissions did you set? Why 700?

Quote:
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
.
.
.
Do I read that you can connect interactively to the server?

Try the sftp with multiple -v (verbose) options and post the log.
    #4  
Old Unix and Linux 6 Days Ago   -   Original Discussion by renukeswar
renukeswar's Unix or Linux Image
renukeswar renukeswar is offline
Registered User
 
Join Date: Jan 2017
Last Activity: 8 December 2017, 4:57 AM EST
Posts: 7
Thanks: 0
Thanked 1 Time in 1 Post
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.


Code:
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

Moderator's Comments:
Not able to transfer files using between server A and B Please use CODE tags as required by forum rules!

Last edited by RudiC; 5 Days Ago at 03:57 AM.. Reason: Added CODE tags.
Sponsored Links
    #5  
Old Unix and Linux 6 Days Ago   -   Original Discussion by renukeswar
Corona688's Unix or Linux Image
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 13 December 2017, 10:16 AM EST
Location: Saskatchewan
Posts: 22,546
Thanks: 1,159
Thanked 4,286 Times in 3,955 Posts
Without seeing your code, I have no idea why its doing that.

Please show your code.
Sponsored Links
    #6  
Old Unix and Linux 5 Days Ago   -   Original Discussion by renukeswar
renukeswar's Unix or Linux Image
renukeswar renukeswar is offline
Registered User
 
Join Date: Jan 2017
Last Activity: 8 December 2017, 4:57 AM EST
Posts: 7
Thanks: 0
Thanked 1 Time in 1 Post
Hi Corona, Thanks for the response.

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

sftp user@xx.xx.xx.xx << EOF.
The Following User Says Thank You to renukeswar For This Useful Post:
Corona688 (5 Days Ago)
Sponsored Links
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Transfer files from one server with bash script Ophiuchus Shell Programming and Scripting 8 02-15-2016 12:52 PM
Do I require remote login access to a windows server to transfer files from a UNIX server vx04 Shell Programming and Scripting 2 01-22-2016 06:40 AM
Help with script to transfer files from one server to another fretagi Shell Programming and Scripting 7 12-07-2015 08:58 AM
SFTP to transfer files from one server to another urfrnddpk Shell Programming and Scripting 1 04-21-2011 01:14 PM
transfer files from the server 1 to server 2 bomozah Linux 2 11-03-2008 07:11 AM



All times are GMT -4. The time now is 10:33 PM.