Hey..learners.. .netrc is a file, used for simplifying the login work in to host server using ftp services in local server. We give the details of machine ip, user name and password in a specific format, for which the ftp services can understand. The ftp services takes the details from this file and gets the login in to the machine id mentioned in the .netrc file, with the given username by taking the given password from the .netrc file.
The format of .netrc file is like as given below:
machine host1.abcd.techg.com login bbvvll password llvvbb
machine 220.127.116.11 login bbvvll password llvvbb
the variables are given in blue colour. First one is
if we have the host machine name. Second one is
if we have the machine ip, we have to use this format
When we give "ftp 18.104.22.168" at the command prompt, it takes the corresponding username and password, and gets the login automatically. The above details should be saved in the file .netrc, which should be stored at the home path of the local server. And as this file contains the username and password, this file should obviously be confidential, means should have only read-write permissions for the owner of the file. So, after creating this .netrc file, Please give chmod 600 .netrc This file is a hidden file now, so one should use "ls -a" to check these kind of hidden files. We can write as many as entries in the file .netrc you want, but they should follow the convention and the file should be a hidden file. Thanks!