Re: Script with 'ftp' and rewrite using 'sftp'



Definately remove the password. Populate authorized_keys with the
appropriate key to allow password-less authentication. The script would be
something like:

sftp $user-name@xxxxxxxxxxxxxxx
cd /cgi-bin/import/
dir
put some.txt
dir
quit

There's no ascii/binary since ssh does it automatically. Here's the help
from 4.5 openssh:

sftp> help
Available commands:
cd path Change remote directory to 'path'
lcd path Change local directory to 'path'
chgrp grp path Change group of file 'path' to 'grp'
chmod mode path Change permissions of file 'path' to 'mode'
chown own path Change owner of file 'path' to 'own'
help Display this help text
get remote-path [local-path] Download file
lls [ls-options [path]] Display local directory listing
ln oldpath newpath Symlink remote file
lmkdir path Create local directory
lpwd Print local working directory
ls [path] Display remote directory listing
lumask umask Set local umask to 'umask'
mkdir path Create remote directory
progress Toggle display of progress meter
put local-path [remote-path] Upload file
pwd Display remote working directory
exit Quit sftp
quit Quit sftp
rename oldpath newpath Rename remote file
rmdir path Remove remote directory
rm path Delete remote file
symlink oldpath newpath Symlink remote file
version Show SFTP version
!command Execute 'command' in local shell
! Escape to local shell
? Synonym for help


John T. Mills


-----Original Message-----
From: IBM AIX Discussion List [mailto:aix-l@xxxxxxxxxxxxx] On Behalf Of Bill
Verzal
Sent: Sunday, February 04, 2007 9:52 PM
To: aix-l@xxxxxxxxxxxxx
Subject: Re: Script with 'ftp' and rewrite using 'sftp'

<< means read from here to the end.

Why take a secure file transfer medium and code a visible password in the
script ?

BV
--- Denny Watkins <watkins@xxxxxxxxxxxxxxx> wrote:

Aixers,

I have an old script written by someone else. The script is as follows
NOTE: ip address,login name, password,etc have been changed):

ftp -inv<<!
open xxx.xxx.xxx.xxx
user user-name password
cd /cgi-bin/import/
dir
as
put some.txt
dir
quit


Question #1: What does "<<!" really mean?

Question #2: How would one rewrite this script to use sftp?

Thanks,

Denny Watkins
Morningside College
Sioux City, IA 51106-1717

Phone: 712-274-5250

Email: watkins@xxxxxxxxxxxxxxx




____________________________________________________________________________________
Don't pick lemons.
See all the new 2007 cars at Yahoo! Autos.
http://autos.yahoo.com/new_cars.html



Relevant Pages

  • [HPADM] [SUMMARY] RE: SFTP Scripting
    ... We are trying to set up an SFTP environment with a partner. ... need to now is to script it so it is non-interactive. ... Echo "Ending of test sftp script ... ...
    (HP-UX-Admin)
  • Re: Ssh and sftp via here document
    ... The file transfer is performed by sftp during an ssh ... session in which the user running the script temporarily becomes ... can be done without storing cleartext passwords in the script. ...
    (comp.security.ssh)
  • Re: sftp exit codes?
    ... I am using scp along with BatchMode on command line. ... better choice over sftp. ... of exit codes for the sftp program and what each one ... I'm actually porting a shell script that use to use ...
    (SSH)
  • Re: sftp script for application promotion
    ... execute the transfers. ... You don't have such things as sftp scrips. ... You can create a shell script ... You can create batch files with sftp though, ...
    (comp.sys.sun.admin)
  • Re: which is better libssh or libssh2
    ... And how is sftp more secure than scp or rsync over ssh? ... As I said AFAIK libssh2 impliments the ssh2 protocol which is more secure ... transmission timing will swamp any script issues. ...
    (comp.security.ssh)