Computing.Net > Forums > Unix > Ftp to a remote server

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

Reply to Message Icon

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:

HOST='host'
USER='user'
PASS='pass'
FILE='text.txt'

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.

Thanks.



Sponsored Link
Ads by Google

Response Number 1
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
Reply:

Thank you very much guys,

I think this should help.



0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: Ftp to a remote server

check file existence on remote serv www.computing.net/answers/unix/check-file-existence-on-remote-serv/7212.html

comparing dates from a file www.computing.net/answers/unix/comparing-dates-from-a-file/3901.html

FTP from SCO UNIX server to a PC www.computing.net/answers/unix/ftp-from-sco-unix-server-to-a-pc/718.html