1827279 Members
2645 Online
109717 Solutions
New Discussion

ftp command

 
harikrishna
Advisor

ftp command

How can i pass the user name and password along with the ip address at the ftp command.
Please give the early reply.

Thanks
HARI KRISHNA
6 REPLIES 6
T G Manikandan
Honored Contributor

Re: ftp command

You can write a script like

ftp -n <open
user username password
bi
mget
EOF

Rajeev  Shukla
Honored Contributor

Re: ftp command

ftp -n << EOF
open xx.xx.xx.xx
user user_name user_password
...
...

..
EOF
T G Manikandan
Honored Contributor

Re: ftp command

It would be better to quit the ftp session in a proper way so use 'quit' before EOF

ftp -n <..
...
quit
EOF
Sanjay Kumar Suri
Honored Contributor

Re: ftp command

Thanks Hari

Your question has answer my problems as well.

To add to other replies use ascii/binary (to take care type of file) and use prompt (if you want to use mget/mput).

sks
A rigid mind is very sure, but often wrong. A flexible mind is generally unsure, but often right.
G. Vrijhoeven
Honored Contributor

Re: ftp command

Hi,

you could use a file called .netrc. That works just like .rhosts, and is a big security risk, just like putting the username/passwd in a script. I would suggest scp if it needs to be secure.

Gideon
Steven E. Protter
Exalted Contributor

Re: ftp command

Seconding the last suggestion.

scp is secure.

http://software.hp.com/portal/swdepot/displayProductInfo.do?productNumber=T1471AA

link:

attaching a config doc.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com