Questions tagged [.netrc]

The .netrc file contains data for logging in to a remote host over the network for file transfers by `ftp`

Purpose

Specifies automatic login information for the ftp and rexec commands.

Description

The $HOME/.netrc file contains information used by the automatic login feature of the rexec and ftp commands. It is a hidden file in a user's home directory and must be owned either by the user executing the command or by the root user. If the .netrc file contains a login password, the file's permissions must be set to 600 (read and write by owner only). This file is part of TCP/IP in Network Support Facilities.

Note:
The .netrc file is not used by any programs when the securetcpip command is running on your system. The .netrc can contain the following entries (separated by spaces, tabs, or new lines):

machine HostName     The HostName variable is the name of a remote host.
                     This entry begins the definition of the automatic login process 
                     for the specified host. All following entries up to the next 
                     machine entry or the end of the file apply to that host.

default              The default variable is the same as machine except that default 
                     matches any name. There can be only one default entry. It must be 
                     the last entry (after all machine entries); otherwise, entries 
                     that follow it will be ignored. This is normally used as:
                                     "default login anonymous password user@site"
                     thereby giving the user automatic anonymous ftp login to machines 
                     not specified in the .netrc file. This can be overridden by using 
                     the -n flag to disable the auto-login.

login UserName       The UserName variable is the full domain user name for use at the
                     remote host. If this entry is found, the automatic login process
                     initiates a login, using the specified name. If this entry is 
                     missing, the automatic login process is unsuccessful.

password Password    The Password variable is the login password to be used.
                     The automatic login process supplies this password to the remote 
                     server. A login password must be established at the remote host, 
                     and that password must be entered in the .netrc file. Otherwise 
                     the automatic login process is unsuccessful, and the user is 
                     prompted for the login password.

account Password     The Password variable is the account password to be used.
                     If this entry is found and an account password is required at the 
                     remote host, the automatic login process supplies the password to 
                     the remote server. If the remote host requires an account
                     password but this entry is missing, the automatic login process 
                     prompts for the account password.

macdef MacroName     The MacroName variable is the name of an ftp subcommand macro.
                     The macro is defined to contain all of the following ftp 
                     subcommands up to the next blank line or the end of the file. If 
                     the macro is named init, the ftp command executes the macro upon 
                     successful completion of the automatic login process. The rexec 
                     command does not recognize a macdef entry.
53 questions
0
votes
1 answer

vim netrc password re-entering

I connect to a ftp server with vim and netrc. I don't have the password stored in .netrc because of security. So when I connect to my server I have to enter the password, which is cooland it works. But if I change the directory, open a file etc. I…
0
votes
1 answer

How do I add multiple accounts (machine, login, password) to my VIM .netrc file?

I have been just connecting to one server via .netrc and it worked fine but now I need to be able to connect the original server and a new account. When I add new account information (machine, login, password) it just signs into the original account…
Classer
  • 465
  • 2
  • 7
  • 18
0
votes
1 answer

Can't run Heroku from Virtualbox shared folder (wrong permission)

I can't run Heroku from Virtualbox home shared folder and receive permission error every time: vagrant@precise32:~/projects/mysite$ heroku login Permission bits for '/home/user/.netrc' should be 0600, but are 777. You should run chmod 0600…
Yahor
  • 43
  • 4
0
votes
1 answer

Use .netrc for corp wifi password?

I use a .netrc file for authentication args for git. I have test automation that configures an Android device before executing tests, and I need the device joined to a corp wifi network. I've scripted this by adding the following parameters to the…
Jacob Stevens
  • 854
  • 1
  • 8
  • 17
0
votes
1 answer

Netrc in Python

I am trying to run a piece of code using netrc lib in Python. I got examples from the Internet, but they have all failed at the first line. import netrc info = netrc.netrc() Traceback (most recent call last): File "./netrc.py", line 2, in…
0
votes
1 answer

How to use .netrc when running MKS Toolkit on Windows?

I am moving an application from Unix (AIX) to Windows. We have MKS Toolkit on the Windows server in order to run our shell scripts fairly unchanged. However, my old FTP jobs depend on the .netrc file. Can anybody tell me whether .netrc is supported…
Sten Vesterli
  • 3,005
  • 1
  • 22
  • 22
-2
votes
1 answer

how to login via machine/vps directly which has blank username and password?

i am trying to download a file from an website which has login protection but the username and password both it blank and have to login like that..... so my question is..... how to download it via curl/wget on my vps ? is there any .netrc way or…
-2
votes
1 answer

re-load variables during script

I have a script which I am using to connect to a sftp server and download some files, the catch is I need to do this for multiple users (7 in total). I have got this working but I am basicly repeating myself 7 times to get this to work (I just put…
1 2 3
4