- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- FTP script on HP-UX won't send password to Windows...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2007 02:57 AM
03-07-2007 02:57 AM
I realize this method is unbelievably unsecure, but the customer is loathe to make changes to what was once a functional procedure.
The script is basically doing this:
-------------------------------
RC=`/usr/bin/ftp -nv <
user ftpuser password
put datafile.1
put datafile.2
bye
EOF_FTP`
print "Return code was: " ${RC}
-------------------------------
However, when I run it, it's now prompting me for the password. I'm not in the mood to completely recode their scripts into "expect", not least because I can never get that to work properly either. :)
Can anyone thing of a way in which you can pass the password to the server and not have it prompt? I've tried a bunch of stuff, including:
-------------------------------
user ftpuser
password
-------------------------------
and:
-------------------------------
user ftpuser\npassword
-------------------------------
I'm pretty stumped. Is there something that the Windows goons need to change on their FTP server settings?
I do know if I do an ftp -nv from the command line, do an "open server.etc", and then type "user ftpuser password", it logs me right in. It just seems to get angered by the space between "user ftpuser" and "password" in the script and treats it like a newline, and then breaks out of the script to prompt me for a password. Argh!
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2007 03:06 AM
03-07-2007 03:06 AM
Re: FTP script on HP-UX won't send password to Windows FTP server
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2007 03:09 AM
03-07-2007 03:09 AM
SolutionI've got a script that does:
ftp -n -v << EOFL >> LOG
open 1.2.3.4
user name pass
bye
EOFL
It works as it should.
I have to wonder if it is getting confused because of the way you have the FTP Script being executed to assign the result to a variable.
What happens you you just do the FTP, then afterwards, do RC=${?} so your script looks like:
/usr/bin/ftp -nv <
user ftpuser password
put datafile.1
put datafile.2
bye
EOF_FTP
RC=${?}
print "Return code was: " ${RC}
By the way, your RC here will ALWAYS be 0. You are exiting FTP with the bye command and that will always have a return code of 0. Even if the ftp fails to login, or fails to transmit a file, your RC will always be 0.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2007 03:12 AM
03-07-2007 03:12 AM
Re: FTP script on HP-UX won't send password to Windows FTP server
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2007 03:13 AM
03-07-2007 03:13 AM
Re: FTP script on HP-UX won't send password to Windows FTP server
Your transfer will be very close to this:
ftpput.pl -h new.server.com -l ftpuser -p password -A datafile.1 datafile.2
STAT=${?}
if [ ${STAT} -ne 0 ]]
then
echo "FTP failed; status ${STAT}." >&2
fi
exit ${STAT}
You can even put your passwd in a .netrc file to make it a bit more secure.
Invoke as ftpput.pl -u for full usage. The really neat thing about this approach is that the Perl script will work equally well if run on Windows -- if one of the free Perls for Windows is installed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2007 03:25 AM
03-07-2007 03:25 AM
Re: FTP script on HP-UX won't send password to Windows FTP server
Who ever said that Windows had to follow standards? Their ftp server breaks rules and dos not follow standards at all.
You will need to modify the script to make it work and know that the script won't work with a REAL ftp server.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com