You don't say which version of Unix/Linux it is but most support the use of a .netrc file in the home directory of the user running the script to provide automatic ftp connections.
.netrc contains the 'machine' name, and userid/password to use for that system.
NOTE that this file MUST have particular security: ownership, group and mask for it to work.
This is probably the easiest way for you to get automatic ftp use without password (or even userid).
Also, use
rather than the ip address. The nodename is resolved in /etc/hosts and the .netrc file (in your home directory) will provide remote nodes ftp credentials.
Search this forum for .netrc
Hope that helps.
---------- Post updated at 09:31 AM ---------- Previous update was at 09:22 AM ----------
Also, remember that you can test the functionality interactively by typing
from your command line before running within your script. If you have configured .netrc properly, the ftp session will connect instantly.
---------- Post updated at 10:34 AM ---------- Previous update was at 09:31 AM ----------
Do be aware that the use of ftp and .netrc is NOT secure in that it transmits unencrypted credentials over the network. Use on a LAN behind a firewall.
hi,
i want to setup a password less FTP to a remote server so that i can ftp to a remote server without the password.
i have setup a passwordless ssh and i am able to use scp commands to connect to the remote server without asking for the password. but when i try to ftp to the same remote... (6 Replies)
Hi
In my shell script I am generating one text file and this text file I want to place in Mount point. THis mount point is havig access to Windows.
I want to put the file in this mount point by using FTP rather normal cp or mv command from my shell script.
This is in order to prevent... (5 Replies)
I am trying to get a file by doing ftp to the server.
The below script works fine but as I type password it is displayed as simple text.
HOST='192.108.245.101'
echo 'username: '
read USER
echo 'password:'
read PASSWD
ftp -n $HOST <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD
lcd... (1 Reply)
HI all,
I need to post some files on to a clients machine and they said we can ftp without username and password. I do the same as a command line it works ftp <hostname>. but when I do that through a script it asks for user name and pasword.
Can any one help me how to do a file ftp.
... (4 Replies)
hi all
i am very new to unix. we had the below scenior
test.bat file which contains
ftp -s:logfiles.scr servername
logfiles.scr contains
username
password
cd path
get file
bye
We had n number of batch(.bat files). which is having the same kind of scr file pointing... (10 Replies)
I am trying to download from ftp server (rsync and postfix). But every time I connect to the ftp server, it prompts for USER and PASS but I don't know which username and and password to use. And I am using command based UNIX OS. (2 Replies)
I know the typical way to script automate an ftp session is to pass all of the commands to ftp, with something 'like' the following:
echo USER $user
echo PASS $pass
My question concerns other methods or tricks people have used so that the username and ESPECIALLY the password are... (7 Replies)
If we set up FTP only users who can't log in with a shell (/bin/false type of shell) and set them up with a default password, like abc123 or something not secure, is there any way for the user to change their own password once they get on the system? (2 Replies)
hi
i am unable to connect to FTP server.My FTP password contain one special charecter '#'.it might be the problem for connecting.please clarify regarding this special charecter in the password.i need some information about restricted charecters in the shell script.
thanks (5 Replies)
I think I may have put this in the wrong forum earlier
the script that follows is an extract from a post someone gave as an answer to a question on ftp within a script
/usr/bin/ftp ftpsiteaddress <<END
verbose on
bin
user username password
cd <directoryname>
put <filename>
mput... (3 Replies)