console.py

A tool to connect to an IOC console without requesting a password

Overview

This program is just a small addition to the console program. It frees the user from entering a password to log on an IOC.

It stores usernames and/or passwords in a file .netrc that is usually present in your home. The IOC name and optional username can be specified as regular program options or as unnamed parameters following the program. The following two statements are equivalent:

console.py -H HOST -u USER

console.py HOST USER

Format of .netrc

A line in a .netrc file has the following form:

machine NAME login USER password PASSWORD

In the line above, "NAME", "USER" and "PASSWORD" are different in each line. "NAME" is usually the hostname, but it is in effect arbitrary. console.py uses "NAME" not for the real hostname but in the way described below:

Note that if you create the file .netrc for the first time you must ensure it is readable only by yourself with this command:

chmod 700 $HOME/.netrc

Quick reference

Reference of command line options

--summary print a one-line summary of the scripts function
--netrc FILE Specify the name of the netrc file. If the option is omitted, the program tries to read the file ".netrc" from your home. A file of this type (see also "man netrc") is a simple way to store login information. You just create a file ".netrc" in your home which should be readable only by yourself ("chmod 700 $HOME/.netrc).
-u, --user USER
 You can specify the user directly with this command line option. If the password is not provided, the program tries to find the entry "Console-by-user-USER" in the .netrc file and takes the password from there.
-p, --password PASSWORD
 You can specify the password with this command line option. If you specify the user and the password with command line options, the program does not read the .netrc file.
-H HOST You can specfiy the host with this option.
-t, --timeout TIMEOUT
 You can specify the timeout for the connection with the console server with this option.
--netrc-line When this option is given, the program does not log onto the IOC. Instead it prints the line you would have to add to your .netrc file if you want to store the username and password there. If this option is given you should either specify the host, the user and the password or you shoudl specify the only the user and the password.
--doc print reStructuredText documentation (THIS text :-)...). Use "console.py --doc | rst2html > console.py.html" to create a html documentation.