• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

SFTP in unix shell script

 
Ranch Hand
Posts: 689
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Everybody,

I know how to use ftp but i dont know how to use sftp.

I tried many times but unsuccessful

I searched in the google but couldn't get good appropriate stuff which is useful for me.

Please can any one help me how to use "sftp" in shell script

can any one provide me sample script

Please help me out!

Thanks!
Sai
 
Saloon Keeper
Posts: 26267
186
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To use SFTP, you need to be talking to an sftp-enabled server.

I normally use SCP myself, it requires that the receiving server be ssh-enabled and that you have a shell login.

SCP commands are fairly simple:

scp fromfile user@toserver:tofile

user and tofile are optional, as the defaults are your current user id and fromfile's filename, but if you forget the ":", scp will think you're just doing a local copy to a "tofile" named "toserver".

tofile is normally relative to "user"s home directory, but you can also copy to an absolute location on the serve, provided your account has appropriate security privileges.
 
saikrishna cinux
Ranch Hand
Posts: 689
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
NO boss
I need SFTP stuff that too with out interating with user while connecting to the server.
dont worry about ftp server.
I have ftp server :-)

Please help me out if any one knows about how to connect to ftp server using sftp (non-interactive)


Thnaks
sai
 
Rancher
Posts: 43028
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Ganymed library implements SSH, SCP and SFTP. It's used in client applications such as Cyberduck, so I would imagine it to be rock-solid.
 
There is no beard big enough to make me comfortable enough with my masculinity to wear pink. Tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic