Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
07-14-2004, 03:53 AM
|
#1
|
LQ Newbie
Registered: Dec 2002
Location: Athens, HELLAS
Distribution: Fedora Core 4
Posts: 22
Rep:
|
sftp automation for downloading files
Hi,
I want to use sftp in order to download some files from a remote server. My case is the following:
1. username: user123
2. pass: pass123
3. remote server: ftp.myserver.com
The commands I want to send after the connection are:
1. bin
2. cd mydir
3. get myfile
I want to write a script to automate this procedure using cron.
Any help regarding the sftp command line abilities would be appreciated.
Thanks

|
|
|
07-14-2004, 04:52 AM
|
#2
|
Senior Member
Registered: Mar 2003
Location: Beautiful BC
Distribution: RedHat & clones, Slackware, SuSE, OpenBSD
Posts: 1,791
Rep:
|
consider using scp.
e.g. scp user@remotehost:/mydir/filename .
with the use of publickeys, you can avoid keying in passwords.
|
|
|
07-14-2004, 05:29 AM
|
#3
|
LQ Newbie
Registered: Dec 2002
Location: Athens, HELLAS
Distribution: Fedora Core 4
Posts: 22
Original Poster
Rep:
|
thanks for your reply.
I did not know how to use the public key, however this site http://bumblebee.lcs.mit.edu/ssh2/ was very helpful.

|
|
|
07-14-2004, 05:30 AM
|
#4
|
LQ Newbie
Registered: Dec 2002
Location: Athens, HELLAS
Distribution: Fedora Core 4
Posts: 22
Original Poster
Rep:
|
Another question.
if my connection is broken do u know if my copy can be resumed?
|
|
|
07-14-2004, 05:55 AM
|
#5
|
Member
Registered: Jul 2004
Location: Switzerland
Distribution: Debi@n, SuSE
Posts: 36
Rep:
|
Hi,
1st method:
you can run ftp with an automated script command execution after connection..
ftp -s:"<your_script.txt>" ftp.myserver.com
The content of your_script.txt could simply be:
user123
pass123
bin
cd mydir
get myfile
by
2nt method:
type in command line the following:
ftp ftp://user123 ass123@ftp.myserver.com:21/mydir/myfile
Hope this helps, bye Kess
|
|
|
07-14-2004, 05:57 AM
|
#6
|
Member
Registered: Jul 2004
Location: Switzerland
Distribution: Debi@n, SuSE
Posts: 36
Rep:
|
Sorry, The smile is a :p
Bye..
|
|
|
All times are GMT -5. The time now is 05:20 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|