I am trying to auto ftp process, but I can't get around the login prompt.
Anyone have any idea?
Very appreciated.
Ste
|
|
0
|
|
|
|
Reply
|
Ste
|
8/2/2003 2:35:45 AM |
|
In article <5sFWa.252$nt1.179@newssvr16.news.prodigy.com>, Ste wrote:
>I am trying to auto ftp process, but I can't get around the login prompt.
I suggest ssh instead. See comp.security.ssh . With ftp you have to store
the password one way or another (except that with anonymous ftp there is
no password to speak of).
You can do ftp something like this:
ftp -n 192.168.0.1 << END
user THEUSERNAME THEPASSWORD
get RELEASE-NOTES
bye
END
--
<peter30kyari@zwallet.com> AWAIT[S] YOUR URGENT RESPONCE
5% will be use for upsetting all the expenses
|
|
0
|
|
|
|
Reply
|
elvis
|
8/2/2003 9:58:56 AM
|
|
In article <5sFWa.252$nt1.179@newssvr16.news.prodigy.com>,
Ste <schen@prodigy.net> wrote:
: I am trying to auto ftp process, but I can't get around the login prompt.
:
You can use an FTP client that was designed to be automated:
http://www.columbia.edu/kermit/ftpclient.html
http://www.columbia.edu/kermit/ftpscripts.html
This happens to be the C-Kermit that is included with HP-UX as /bin/kermit.
However, the latest C-Kermit version, 8.0, which is the one that includes
the scriptable FTP client, is found only on HP-UX 11.22. If you have an
earlier HP-UX release, you can upgrade C-Kermit version here:
http://www.columbia.edu/kermit/ckermit.html
http://www.columbia.edu/kermit/ck80binaries.html#hp
- Frank
|
|
0
|
|
|
|
Reply
|
fdc
|
8/2/2003 5:49:39 PM
|
|
"Ste" <schen@prodigy.net> wrote:
>I am trying to auto ftp process, but I can't get around the login prompt.
>
>Anyone have any idea?
>
>Very appreciated.
>
>Ste
>
Ste,
Have a look at the ftp man page.
There is a switch on the ftp command to turn off login prompt, can't
remember what it is by I have wriitten many scripts to do automatic
ftp.
Your ftp script will then need to issue the ftp command to login.
Regards,
Ted.
==============================================================
| Ted Linnell <edlinnell@acslink.net.au> |
| |
| Nunawading, Victoria , Australia |
==============================================================
|
|
0
|
|
|
|
Reply
|
Ted
|
8/3/2003 8:59:21 AM
|
|
> I am trying to auto ftp process, but I can't get around the login prompt.
>
> Anyone have any idea?
Use .netrc file.
Alain.
|
|
0
|
|
|
|
Reply
|
Alain
|
8/3/2003 8:37:41 PM
|
|
Use the Here document methodology, putting a `cat secured_file_with_uid/pwd`
just after your open. Putting your uid/pwd over the net in telnet text is
inevitable, but the above in your script will keep the uid/pwd somewhat
secure on the ftp'ing box. I it really matters, make use of vpn or vpn-like
protocols. Otherwise, you option may be to do some socket programming and
skip the ftp. It ain't that hard, and you might enjoy it.
"Frank Thyes" <frank.thyes.nospam@gmx.net> wrote in message
news:bguc1f$scu97$3@ID-124231.news.uni-berlin.de...
> Alain <ota1998@hotmail.com> wrote:
> >
> >> I am trying to auto ftp process, but I can't get around the login
prompt.
> >>
> >> Anyone have any idea?
> >
> > Use .netrc file.
>
> The only way i know but using .netrc is realy insecure...
>
> Frank
>
> --
> The great thing on multitasking is that several thing can go wrong at one.
|
|
0
|
|
|
|
Reply
|
GT
|
8/8/2003 2:43:36 AM
|
|
Still trying?
What about the thing below
This works for me. I made some error and sanity checks around it as well at
the office but don't have the script handy here at home.
Paul
#!/usr/bin/ksh
#
#
# make a ftp command file. You can use enviroment variables in it as well
#
USER=myaccount
PASSWD=secret
LOCALDIR=/my/local/dir
FILES=$(cd LOCALDIR ; ls *.txt)
NFILES=$(echo $FILES |wc -w)
cat <<EOF >myftp.cmd
user $USER $PASSWD
lcd /my/local/directory
cd $LOCALDIR
prompt off
type ascii
put myfile.txt myfile.txtnew
chmod 644 myfile.txtnew
rename myfile.txtnew myfile.txt
quit
EOF
# The actual ftp
ftp -nv <<myftp.cmd >myftp.log 2>myftp.err
# some checking
result=$(grep -c "^226" myftp.log)
if [ $result -ne $NFILES ]
then
echo "ftp failed"
exit -1
fi
|
|
0
|
|
|
|
Reply
|
Paul
|
8/8/2003 5:31:09 PM
|
|
Actually, you could also grep the myftp.log/err for all the result codes.
You get one for each operation - open, login, xfer, etc. They should be
2xx, not 4xx or 5xx, and are well documented. You might want to ls -l the
files after the xfer, to document that they arrived and are of some size.
Optionally, you might want to run a 'site' or 'quote site' command of some
sort. For instance, given the right ftp pgms, you could compress, send, and
uncompress, if you have a skinny pipe but fast machines. FTP is pretty fun
if you have a good one.
"Paul Sure" <phv_temp@yahoo.com> wrote in message
news:vj7niu8dab7aee@corp.supernews.com...
> Still trying?
>
> What about the thing below
> This works for me. I made some error and sanity checks around it as well
at
> the office but don't have the script handy here at home.
>
> Paul
>
> #!/usr/bin/ksh
> #
> #
> # make a ftp command file. You can use enviroment variables in it as well
> #
> USER=myaccount
> PASSWD=secret
> LOCALDIR=/my/local/dir
>
> FILES=$(cd LOCALDIR ; ls *.txt)
> NFILES=$(echo $FILES |wc -w)
>
> cat <<EOF >myftp.cmd
> user $USER $PASSWD
> lcd /my/local/directory
> cd $LOCALDIR
> prompt off
> type ascii
> put myfile.txt myfile.txtnew
> chmod 644 myfile.txtnew
> rename myfile.txtnew myfile.txt
> quit
> EOF
>
> # The actual ftp
>
> ftp -nv <<myftp.cmd >myftp.log 2>myftp.err
>
> # some checking
>
> result=$(grep -c "^226" myftp.log)
> if [ $result -ne $NFILES ]
> then
> echo "ftp failed"
> exit -1
> fi
>
>
|
|
0
|
|
|
|
Reply
|
GT
|
8/9/2003 2:09:58 AM
|
|
|
7 Replies
448 Views
(page loaded in 0.136 seconds)
Similiar Articles: Ftp Automatic Login Help - comp.sys.hp.hpuxI am trying to auto ftp process, but I can't get around the login prompt. Anyone have any idea? Very appreciated. Ste ... help in clearing login screen..... - comp.unix.solarisFtp Automatic Login Help - comp.sys.hp.hpux... on HP - help please - comp.sys.hp.hpux Hi , I'm using expect to script automatic telnet ... html For a sample Telnet script ... ldap bind password help - comp.unix.adminFtp Automatic Login Help - comp.sys.hp.hpux... Hi, has anyone managed to login into a UNIX system as ... (like ftp, telnet and many other servers on UNIX do). ... FTP User and Password - comp.os.vxworksFtp Automatic Login Help - comp.sys.hp.hpux... the password one way or another (except that with anonymous ftp there is no password to speak of). Running a script through Automatic scheduler - comp.unix.shell .....profile is only run in interactive login shells. The shell that autosys runs is ... run manually does perform the job quite > well, but when scheduled thorugh Automatic ... Secure FTP API for Java Released - comp.lang.java.security ...Ftp Automatic Login Help - comp.sys.hp.hpux If you have an earlier HP-UX release, you can ... JAAS and UNIX - comp.lang.java.security Hi, has ... Solaris 10? - comp.unix ... comp.sys.hp.hpux - page 13Ftp Automatic Login Help 7 145 (8/2/2003 2:35:45 AM) I am trying to auto ftp process, but I can't get around the login prompt. Anyone have any idea? Turn off telnet/ssh login message - comp.unix.solarisHas someone modified /etc/profile or /etc/.login on this system? -- James Carlson ... Thanks for your help! > I haven't seen the second bit of the message before. Leaving a process running after log-off - comp.unix.solaris ...Ftp Automatic Login Help - comp.sys.hp.hpux Leaving a process running after log-off - comp.unix.solaris ... Ftp Automatic Login Help - comp.sys.hp.hpux I am trying to auto ... libncurses.so.5 open failure - comp.unix.solarisMy path in the ".login" file on my home area is pointing to /usr/bin. Would anyone ... -- Thomas E. Dickey http://invisible-island.net ftp://invisible-island.net Ftp Automatic Login Help - comp.sys.hp.hpux | Computer GroupI am trying to auto ftp process, but I can't get around the login prompt. Anyone have any idea? Very appreciated. Ste ... Using FTP Batch Scripts - Microsoft SupportFTP (file transfer protocol) is a file transfer utility ... However, if the FTP host implements automatic login ... Microsoft Developer Network (MSDN) Get Help ... 7/26/2012 3:03:55 PM
|