I’ve mentioned it before, but Chris Siebenmann is basically the Raymond Chen of the UNIX world, and today he’s filling that role perfectly once again.
I recently read Simon Tatham’s Nitpicking the shell history scene in Tron: Legacy, where one thing that surprised Tatham was the film using ‘
login -n root‘ to becomerootinstead of ‘su‘. This surprised me because I found that perfectly ordinary, and this turns up both a bit of Unix history and a difference between modern Unixes.Plain ‘
↫ Chris Siebenmannsu‘ can let you become another user, includingroot, but what it explicitly doesn’t do by default is create a new login shell for that user. If you do ‘su root‘, the new root shell normally inherits most of your environment, your current directory, and so on. Sometimes this is what you want and sometimes you really want a new login environment, and originally in Unix how you got the latter was to run ‘login‘ from your existing shell session (and this meant that login was setuid root, like su).
Unsurprisingly, this distinction has persisted to this day in various UNIX-like operating systems, but in different ways. Some maintain the explicit distinction, while others have more or less standardised on using su for both use cases. It’s an interesting bit of UNIX archeology.
