Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SFTP in unix shell script

 
saikrishna cinux
Ranch Hand
Posts: 689
  • Mark post as helpful
  • send pies
  • 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
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18157
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic