First Boot into Linux

The moment of truth

When the installation is complete, the CD/DVD will be ejected. Remove it and restart your machine. Keep your fingers crossed and maybe you will get a login screen. If not, you may want to try another version of Linux. I find it is by far the easiest way to go.

Secure the shell

After login, open a terminal window. Enter nano .bashrc or whatever other editor you want to use, and add the following lines to the end of the file:
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'

set noclobber

EDITOR=<your favorite editor>
VISUAL=<your favorite editor>
Don't make typos or mess up the rest of the file. Exit nano with [Ctrl]-[X] (press X while holding down [Ctrl]). Or use the equivalent procedure for your editor. Exit the terminal window with exit.

The shell will now confirm with you before a file is actually deleted. To delete large numbers of files without confirmation, put rm between quotes and check for typos and blank spaces before pressing that [Return] key. For example, 'rm' -r / tmpdir is quite different from 'rm' -r /tmpdir. You may not want to try it, especially if you are logged in as root.

And no, prefixing it with "sudo -u root" if you are not logged in as root does not make you any safer. Quite the contrary, sudo -u root rm -r / tmpdir ignores the alias and goes for it. You may not want to try it. If you insist anyway, maybe you should try sudo -u root rm -i -r / tmpdir first.

Personally I prefer tcsh over bash. You can enable a button for it. Right click Terminal in the applications menu, select "Add this launcher to panel," then right-click the new button in the panel bar and select Properties. Select "Application in terminal" from the drop-down list, and enter "tcsh" for command. Ubuntu does not install tcsh shell by default; the button will only work after you have installed it with Synaptic. Alternatively, you can set your default shell in /etc/passwd.

For tcsh, you will want your .tcshrc file to include the lines

alias rm 'rm -i'
alias cp 'cp -i'
alias mv 'mv -i'

set noclobber

setenv EDITOR <your favorite editor>
setenv VISUAL <your favorite editor>
Note the beautiful compatibility (BC) of different Unix shells. The blank lines and one of the non blank ones are actually identical.

Don't think your .login or .profile will be executed, as standards say they must, because that would be BC. And Backwards Compatible is one of the filthiest words that Unix has ever ostracized. If you do want your .profile/.login/.whatever executed in Debian sid, from the bash terminal,

  sudoedit -u root /etc/X11/Xsession.d/99xfree86-common_start
and change the exec line to
# was: exec $STARTUP
exec -l $SHELL -c "$STARTUP"
DO NOT make this change in Ubuntu to /etc/X11/Xsession.d/99x11-common_start. It will prevent starting X-windows. Apparently, the -l is no longer recognized in exec.

I have noted that bash may give better error information if a command crashes. If a command crashes in tcsh with no good excuse, try entering bash and repeat the command. Enter exit to get out of bash again.

Check basic system

Various hardware should work out of the box. You will need to configure printers using the appropriate system menu option. External USB (and firewire) disks may be mounted, but not at the places you want and without the ownership you want. These things will need to be fixed.

Enable root login

Linux versions like Debian and Ubuntu take it upon themselves to make login as root as hard as possible. The general approach is to provide a constant stream of annoyances to make people hate Linux as much as they possibly can be made to.

The stated purpose is to convince you that root login is very dangerous. Unfortunately, it is not. Sure, since root has the privileges to move or delete any file, an inexperienced user might find the command line, then /usr/bin, then mistakenly type 'rm *' intending to type 'room for 8 more' because the keyboard has coffee splashed on it.

But it just does not happen that way. Remember that non privileged logins are only a recent fad. Not too long ago, you always had complete privileges within your own computer. Inexperienced users are smart enough not to touch anything they do not understand. They do not find the Windows folder and delete it. (I am sure your nephew is an exception.) Inexperienced users got into trouble because they did not have a UPS and no backups when the resulting inevitable hard disk crash occurred. Not having privileges makes it harder for inexperienced users to set up regular backups, because it requires understanding of such concepts as different "owners" and file protection...

While many careless users ended up with viruses, (in my experience, mostly the ones who really, really, did not care), switching to non privileged accounts will simply have the next generation of viruses prompt for the root password. Or even more simply, just look in .wvdail.conf. The solution to such external treats is not preventing root login, but to build safer browsers and e-mail packages. Unfortunately, the people who are supposed to do that find it less work/more profitable to futilely prompt users not to login as root, than to do any programming that would actually make a difference in safety

And even if careless users end up with a virus, it can usually be removed fairly easily. How do you separate "very dangerous" from "dangerous" and that from "potentially dangerous" and that from "potentially very annoying" and that from "potentially annoying, but I did get a break while they were fixing my computer?" Would you consider running out onto a busy major road while blindfolded more "very dangerous!" than login to root or less? Be specific. Be quantitative.

The problem is not that people login as root, the problem is that these root privileges are mindlessly propagated to inherently insecure applications like browsers and e-mail. Of course, to drop the privileges and ownership for insecure application subprocesses would require a small bit of programming and that might conceivably constitute work.

But who do you think is more likely to provide a system password when asked by a dubious source:

  1. A non-privileged user who has been supplying his/her password a thousand times to vaguely identified pop-up windows in just the last 30 minutes?
  2. A privileged user who has never had such a request until his/her unprivileged browser needed it to install a virus?

As far as experienced users are concerned, I have used privileged accounts all my many decades of intensive computer use and never had a problem that could have been avoided by being logged on without privileges. And no, I do not regularly update my software, especially at home where I am on a plain phone line. No, never a virus, thank you. Experienced users do not click on links or attachments in e-mails. And while it is certainly possible for the bad guys to exploit a bug in a browser, it is not by far as easy as some financially interested people want to make you think. It requires a web site that either lasts only a day or else has a suspicious URL, and then the bad guys must luck into the right unfixed version of the right browser in the right operating system, and then that the user waits out the virus upload without clicking on another link. That is a lot of hassle where an attachment in an e-mail provides direct access to a system and can reach countless users with no strain on any web site of the bad guys.

By all means, use a non privileged account for daily operations such as web access and e-mail if you want to play it safe. (You will not be playing it safe unless you keep solid backups, but anyway.) In principle, you can also do system work from that non privileged account. If you just install packages using synaptic, it does seem to work fine.

But any serious system setup and fix-up requires an endless stream of su, sudo, sudoedit, gksu, gksudo, su root, sudo -u root, sudoedit -u root, gksu -u root, and gksudo -u root. That is a major hassle and therefor very dangerous. An annoyed system operator, typing large quantities of superfluous commands at great speed, having a large fraction rejected because of typos, is not a safer system operator than one who is focussed on the system commands themselves, rather than on how to enable them.

And a system operator who picks up a computer in frustration and crashes it down is very dangerous because the crash might take out the backup disk too.

Both Debian and Ubuntu create a non privileged account (named after your first name by default) and try to prevent you from login as root. In a Debian install it is a simple matter to go into the login screen preferences and click "enable system administrator login." In Ubuntu, you must also go into "Users and Groups", select and unlock root, and set a password for it.

If you enable root login, also secure the root shell as described in the previous section. Use a decent password for root, because the bad guys already know the user name. The bad guys in this case are the people in your IS department. Here at Florida State University, they periodically try to crack the password on every machine on campus. One postdoc used what he thought was safe, an Asian-Indian word. Unfortunately, it was equivalent to two small English words behind each other, so they cracked it and disabled the machine.


Applies to software obtained May 2009.
Return to Linux on Lifebook S6520