How do you use ftp in Unix CLI?
You will give ftp hostname/ip
.
It will take you to the ftp>
prompt.
Now you will give subcommands like login
, cd
, get
, delete
etc.
You always need to login by giving username and password in the login
subcommand. Have you tried automatic login method? It is in ftp
.
The .netrc file
First you need a file .netrc
in your home directory. In the file, you need to enter the username and password to be used with each host.
Example line in .netrc :machine <remote machine> login <remote username> password <remote password>
Set the mode for the file to 400, ie. chmod 400 ~/.netrc
Using ftp automatic login
Just give ftp hostname/ip
, if the hostname is present in .netrc
, ftp
will use the information and automatically login for you.
To avoid using the .netrc file, just use ftp -u hostname/ip
.
Wednesday, December 10, 2008
Ftp Automatic Login
Posted by
atoztoa
at
2:59 PM
Labels: Tips n Tricks, Unix
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment