No login credential. Connect automatically your FTP server


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!

About Eugen Mihailescu

Always looking to learn more about *nix world, about the fundamental concepts of arithmetic, algebra and geometry. I am also passionate about programming, database and systems administration.
This entry was posted in Uncategorized and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s