Please note that this blog has been moved.
Now it has its own domain: mynixworld.info 🙂
If you want to read the latest version of this article (recommended) please click here and I open the page for you.
I have a dozen of FTP accounts (clouds, remote servers, etc) and I’m using them quite often nowadays. If you are a computer geek like me then you will mostly work at your tty console so no graphical FTP program whatsoever.
How do you manage to keep the track of all your connection host names, login user names and passwords?
I’ve found a simple solution: setup a .netrc file in your home directory and that’s all.
It has a quite simple structure: on each row you may define a FTP connection providing the host name, the login name and its password. For example:
machine urdomain.org login <my-username1> password <my-password1> machine mydomain.net login <my-username2> password <my-password2>
Now, anytime you want to log into your favourite FTP server you should do only type a ftp command like “ftp <my-machine-definition>” and press ENTER. The ftp command will figure out by itself what user and password to choose/use.
For instance, by typing the following command at the terminal:
user@gentoo ~ $ ftp mydomain.net
I get automatically connected to the FTP server with the user <my-username2> and its password <my-password2>.
So I don’t have to recall all the domain names, users and password. And it works!