05-03-2013
You don't say what Unix distro you are using but there is a 'standard' method of doing this which is to use .netrc
If ftp is launched with a target nodename but no credentials then, in addition to looking up the target ip address in /etc/hosts, it will also look for a file .netrc in the home directory of the user under which it is running. It will look in there to see if the target nodename is listed and, if so, will use the userid and passwd given to make the connection. This completely automates the ftp connection (you can even test it interactively). With regards to your security concerns (understanding that ftp is insecure from a networking point of view) the .netrc file must have access rights for that specific account only in order for it to work (the way is way designed) so any other user on Unix could not gain access to the Windows password. Additionally, even better, the account calling ftp need not be an interactive login at all; could just be used by cron.
Try a searching the Unix.com forum for ".netrc" and also Google search for your distro + .netrc
Hope that helps.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
hello guys ,
Is there a way to backup unix files from a windows 2003 server
i have a tape drive in the unix box but just for extra security what would be the best way to backup unix files .
Thanks a lot (7 Replies)
Discussion started by: josramon
7 Replies
2. Windows & DOS: Issues & Discussions
I've read some of the threads on here about ftping. It seems most relate to ftp-ing from one unix environment to another. What I'm looking for is a way to ftp files from unix out to an windows NT machine that is connected to a network. If anyone has a simple or complex example, I would sure... (8 Replies)
Discussion started by: anthreedhr
8 Replies
3. UNIX for Advanced & Expert Users
hi
i want run an unix application from a windows program/application.i am using SSH(command line version)to log on to a unix machine from windows. the application has to read a configuration file inorder to run. the configuration file .CFG is in bin in my home directory. but the application... (1 Reply)
Discussion started by: megastar
1 Replies
4. Shell Programming and Scripting
Hi
i need to FTP files from windows to unix(sun) machine using script. what are the scripts commands i need to use to transfer files
Thanks (2 Replies)
Discussion started by: bmkreddy
2 Replies
5. Shell Programming and Scripting
I am using windows Xp. From windows I would connect to my IBM AIX unix machine using telnet client. Is there any command available to view the IP address of Windows machine from Unix? (Note that ifconfig will give unix mahcine's IP address currently logged in.) (3 Replies)
Discussion started by: mvictorvijayan
3 Replies
6. Shell Programming and Scripting
i need to ftp a file from windows to a unix machine by executing a sript(perl/shell/php) from that unix machine.i can also use HTML and javascript to build forms. (3 Replies)
Discussion started by: raksha.s
3 Replies
7. Shell Programming and Scripting
Hello World,:cool:
Is there a Way to create a UNIX enviornment on Windows bases Machine for enchancing my Skills regarding UNIX scripting.:confused:
I know a software name VMware but i dont know how to confiure it:rolleyes:. If this is the apporitate tool for UNIX please guide me the... (3 Replies)
Discussion started by: jojo123
3 Replies
8. UNIX for Dummies Questions & Answers
What is the best way to learn UNIX, shell, and Perl on a Windows 2000 machine? My place of employment uses Solaris and Perl and I would like to learn some UNIX skills on my home PC.
I read about "dual boots", "Microsoft Windows Services for UNIX", and "cygwin". What other free options are... (9 Replies)
Discussion started by: wolfv
9 Replies
9. UNIX for Dummies Questions & Answers
Hi Friends
Pl. clarify the following.
1. By using ftp hostname we can connect each other as long as within the n/w. Provided user name and password.
2. Using mget****(required files with extension) can trasnsfer all the files(text as well as graphical formats).
3. How we can reproduce the... (2 Replies)
Discussion started by: mohamedfaizyka
2 Replies
10. IP Networking
hi, i want to write a shell script code which transfers files from a directory in unix server to a directory in a windows machine.. can any1 give me a sample code which uses ftp or sftp command..
thanks very much, (3 Replies)
Discussion started by: Little
3 Replies
netrc(4) Kernel Interfaces Manual netrc(4)
NAME
netrc, .netrc - Specifies automatic login information for ftp
SYNOPSIS
$HOME/.netrc
DESCRIPTION
The .netrc file contains the information used by the automatic login (autologin) feature of the ftp command. It is a hidden file in your
home directory and must be owned by the user logging in, or by the root user. If the .netrc file contains a login password, the file's
permissions must be set to 600 (read and write by owner only).
The .netrc file can contain the following entries (separated by spaces, tabs, or newlines): Where host is the name of a remote host. This
entry begins the definition of the autologin process for the specified host. All following entries up to the next machine entry or the end
of the file apply to that host. This is the same as machine, except that default matches any name. There can be only one default token,
and it must appear after all machine tokens. This is normally used as follows: default login anonymous password user@site The preceding
command line gives the user automatic anonymous ftp login to machines not specified in .netrc. This can be overriden by using the -n flag
to disable autologin. Where user is the username to use at the remote host. If this entry is found, the autologin process initiates a
login using the specified name. If this entry is missing, the autologin process fails. Where password is the login password to be used.
The autologin process supplies this password to the remote server. A login password must be established at the remote host and that pass-
word must be entered in this file, or the autologin process fails and you are prompted for the login password. Where password is the
account password to be used. If this entry is found and an account password is required at the remote host, the autologin process supplies
the password to the remote server. If the remote host requires an account password but this entry is missing, the autologin process
prompts for the account password. Where macro is the name of an ftp subcommand macro. The macro definition starts on the following line
and is defined to contain all of the following ftp subcommands up to the next blank line. If the macro is named init, ftp executes the
macro upon successful completion of the autologin process.
FILES
Contains automatic login information.
RELATED INFORMATION
Commands: ftp(1). delim off
netrc(4)