2

In trying to solve a problem, I discovered the --session-command argument to su, as documented here. I tried to use it on my Ubuntu 12.04 system at work, but got an 'unrecognized option' error. Sure enough, it doesn't even show up on the man page for su!

The linked manpage does say --session-command is 'discouraged' but doesn't say why.

Out of curiosity, I connected to a CentOS 6.2. server at my work, and --session-command is recognized.

Further research led me to discover that the su used by Ubuntu comes from the login package, whereas in CentOS it comes from coreutils. Ubuntu also has a coreutils package installed by default, but it doesn't contain the FSF's standard su implementation. A detailed comparison shows that coreutils from both distros contain 105 executable files, but there are several differences (most of which seem to just be the installed location of the files).

My question: Is --session-command left out of Ubuntu's (or Debian's) superuser command by design, or has Ubuntu's divergent implementation simply not caught up with FSF? If by design, what is the reasoning for the omission? Related question: Why not use all the FSF's GNU Utils, anyway?

I'm sure this is documented somewhere but google was not forthcoming, given my search criteria.

Lambart
  • 2,760
  • 1
  • 22
  • 27
  • 2
    http://man7.org/linux/man-pages/man1/su.1@shadow-utils.html Note the Another version of this page is provided by the shadow-utils project on the top of the page you provided in your link. Although I don't know the specific reasons. – falconer Jan 14 '14 at 21:23

1 Answers1

0

Ubuntu and Debian uses the shadow-utils package since a worthwhile (log file goes to 01 Jan 1996). The util-linux su was moved from coreutils to util-linux package recently, the version in coreutils needed to be specifically build with it (most distros didn't). Apparently the only reason is that Debian always used shadow-util own implementation instead of coreutils su.


The header you will notice a message saying that there's another man page provided by the shadow-utils package which is the same as Debian/Ubuntu uses. If you see the bottom of the man page if both Ubuntu and CentOS you will notice this too.

In summary you are reading the wrong man.

Braiam
  • 67,791
  • 32
  • 179
  • 269
  • Although this doesn't answer my question, it is informative. Thanks. – Lambart Jan 16 '14 at 19:45
  • @EricLambart actually it answers your question and beyond, you ask "why su parameter isn't available in Ubuntu but in CentOS?" which I answer "CentOS uses another package for su which Ubuntu doesn't" – Braiam Jan 16 '14 at 19:47
  • I just edited in an attempt to clarify the question, but in the original (and current) text you'll see that through my own research I already understood that the two OSes use different packages to provide their respective implementations of su. And Ubuntu's su comes not from a shadow-utils package (dpkg -l shadow* shows there's no such thing), but one named login. My real question was, and is: WHY? Why does Debian/Ubuntu use a non-GNU implementation, lacking a useful feature? I suspect it is due to security concerns, but I was hoping for something more concrete. :) – Lambart Jan 16 '14 at 20:55
  • @EricLambart apparently, going from what this USENET list says, su from the util-linux was moved from the coreutils package to util-linux, while Debian always used shadow-util. – Braiam Jan 16 '14 at 22:04