Replace FTP with SFTP | Unix Linux Forums | UNIX for Dummies Questions & Answers

  Go Back    


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Replace FTP with SFTP

UNIX for Dummies Questions & Answers


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 03-25-2013
desai.vishnu desai.vishnu is offline
Registered User
 
Join Date: Mar 2013
Last Activity: 25 March 2013, 8:55 PM EDT
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Replace FTP with SFTP

Hi All,

I am in the process of replacing SFTP instead of FTP to make data more secure. In one of my FTP script I have Quote Site command. I would like to know, what is the option to replace this in SFTP


Code:
ftp -n -v <<! | tee -a $LOG | grep "Transfer complete" >/dev/null
   open $remote_address
   user ${remote_login_id} ${remote_password}
   quote site $quote_site_cmd
   cd $remote_dir
   binary
   put $local_file $remote_file
   quit

Please help me to solve this.

Thanks in advance
Vishnu

Last edited by Corona688; 03-25-2013 at 06:30 PM..
Sponsored Links
    #2  
Old 03-25-2013
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 1 October 2014, 1:35 PM EDT
Location: Saskatchewan
Posts: 19,480
Thanks: 796
Thanked 3,289 Times in 3,084 Posts
sftp is not a drop-in replacement for ftp. 'get' and 'put' work mostly the same, but passwords and such are very different. It doesn't do translation like FTP does, it transfers everything binary.


Code:
sftp ${remote_login_id}@${remote_address} <<EOF
cd ${remote_dir}
put ${local_file} ${remote_file}
quit
EOF

It will not take passwords from anywhere but the terminal, you cannot put them in the here-document. This is a security precaution, since stored plaintext passwords are extremely difficult to keep safe.

If you want it to login automatically, you should arrange safe, secure passwordless logins via keys instead.

Last edited by Corona688; 03-25-2013 at 06:37 PM..
Sponsored Links
    #3  
Old 03-25-2013
desai.vishnu desai.vishnu is offline
Registered User
 
Join Date: Mar 2013
Last Activity: 25 March 2013, 8:55 PM EDT
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Replace FTP (Quote and site) to SFTP

I am looking Quote and Site command option in SFTP. The code is presented is used for FTP and used in one of my application. Please let me know similar or new approach to overwritten the quote an site command
    #4  
Old 03-26-2013
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 1 October 2014, 1:35 PM EDT
Location: Saskatchewan
Posts: 19,480
Thanks: 796
Thanked 3,289 Times in 3,084 Posts
Without knowing what $quote_site_cmd actually is, I cannot say what you should replace it with. It's possible there is no drop-in replacement -- sftp doesn't do a lot of the odd inter-mainframe translation things ftp used to. On the other hand, these things are generally unnecessary now. (But may be relevant if dealing with old mainframes.)
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Migrate from FTP to SFTP Nitin Varshneya Shell Programming and Scripting 7 12-24-2012 01:20 AM
Why is sftp working but ftp not manni2 Solaris 11 07-09-2012 02:09 AM
FTP / SFTP confusion mokachoka UNIX for Dummies Questions & Answers 1 09-18-2009 07:11 AM
amend ftp to sftp new2ss Shell Programming and Scripting 1 02-15-2009 11:26 PM
FTP to SFTP conversion shihabvk Shell Programming and Scripting 4 03-30-2007 06:53 AM



All times are GMT -4. The time now is 08:27 AM.