Linux Tips and Tools

From Research
Revision as of 04:53, 2 September 2005 by Mmmark (talk | contribs) (→‎Screen)
Jump to navigation Jump to search

Automatic (Pronounceable) Password Generation

Use of automated tools will help ensure high-quality passwords, enhancing security. apg is one such tool, which (by default) attempts to generate pronounceable passwords. Once apg is installed, invoking it like this will produce best results:

hostname ~ # /usr/bin/apg -M NCL -k -t -m 9 -x 9 -n 10 -E OWL | egrep -v [owl]

Explanation of options:

  • -M is a mode-switch, with following options which tell apg what characterset to use
    • -N numbers must be included with each password
    • -C upper-case (capital) letters must be included
    • -L lower-case letters must be included
  • -k check every generated password using cracklib. Cracklib support must be compiled-in.
  • -m 9 minimum password length
  • -x 9 maximum password length
  • -n 10 generate 10 passwords After the egrep filtering below, you will get substantially fewer than 10 results.
  • -E OWL exclude letters (upper-case only possible) OWL from password. This prevents confusion with "oh" and "zero"; "ell" and "one".
  • | egrep -v [owl] does the same as above, except it filters out/discards passwords with lower-case owl

Screen

Screen is a very powerful terminal application that makes server and remote maintenance much easier.

Screen sessions can be created, detached, and then later resumed from another machine. This allows you to ssh to a machine, start a compile or emerge, detach and logout, and then come back later to the session and see it finished.

Screen session are created from the terminal with

# screen

A session is detached by a Ctrl-a d.

There are three more commands you should know:

# screen -r
# screen -ls
# screen -r ####

The first to reattach a session, and the second to list the screen sessions. The third is useful if there is more than one screen sessions you can reattach. Just list the sessions and then reattach with the specific numbers given for the session you want.