Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Ftp to a remote server
Name: div31 Date: November 11, 2002 at 08:55:32 Pacific OS: Unix CPU/Ram: tt
Comment:
Hi I am trying to ftp a file to a remote server. i used the following script:
ftp -n $HOST << endscript quote USER $USER quote PASS $PASS put $FILE quit endscript exit 0
My question is that is there a way by which i can avoid hard coding the user name and password in the script. Any help/ideas would be greatly appreciated.
Name: David Perry Date: November 11, 2002 at 10:23:54 Pacific
Reply:
the ncftp ftp client allows you to store username password information in the .ncftp config file.
0
Response Number 2
Name: div31 Date: November 12, 2002 at 05:39:00 Pacific
Reply:
Can you please give me some more info about this config file or guide me as to where can I read more about it.
Thanks a lot.
0
Response Number 3
Name: Leigh Date: November 12, 2002 at 14:56:24 Pacific
Reply:
The other option is to use the .netrc file. This is a file that resides in your home directory (with your .login etc) and contains the server name, the userid and password and logs in automatically.
When doing an ftp to a server listed in .netrc, it uses the userid and password in the .netrc file. (The leading . means the file is hidden).
You may want to do a man ftp or man .netrc to get more details.
Cheers Leigh
0
Response Number 4
Name: div31 Date: November 13, 2002 at 05:40:37 Pacific
Summary: Hello I have a shell script that runs 5 times a day and ftps to a remote server...i only want it to ftp if $FILE exists on the remote server...here is the script..please help ftp -n $HOST <<END_...
Summary: Hi , Thanks for quick reply. I won't be able to use the "ls -last dir/*" command, since the file is generated by doing an FTP to a remote server and listing the files using ls command. The FTP protoco...
Summary: Unix runs a lot of services by default(A side effect of a net aware OS) telnet is run by the super daeman called inetd which will launch other Unix daemans not run independently and under the configur...