Be alert for the heimdal port's instance of "su"
I can't seem to recall why, but last week a port I was trying to install depended on the heimdal port. So I installed it and went on my merry way ... until today that is, when I ended up doing this for: $ sudo su - postgres81 Whoops! That "su" is not the "su" you might be thinking of. That "su" is: /path/to/macports/bin/su as in /opt/local/bin/su installed by the heimdal port. Yikes! More than one su to choose from? Could be scary for the unaware! The problem is that by default the Heimdal "su" wants to use Kerberos so it stops and asks you ( even though you've first sudo'ed to root using Apple's "sudo") what is the password for the user you're su'ing to (in the case above postgres81). If you don't have kerberos running then it will complain but will then revert to your local NetInfo domain (or I presume Open Directory or LDAP) for accessing passwords. Regarding not having kerberos running, no problem, the Heimdal man page says you can disable the default kerberos check with a "-K" but that would then mean that you'd have to do "su -K postgresql81", and that would mean you'd have to manually modify startup scripts such as that used by the postgres81 user for firing up PostgreSQL 8.1.x that its launchd plist in /Library/LaunchDaemons points to. It might be worth the extra manual work but it probably depends on your needs. Yeah, there are other ways to force use of /usr/bin/su but anyway, the Heimdal cloaking of su threw me off today so I thought I'd warn others ahead of time in case there are some ports that depend on Heimdal and you end up installing (without deactivating) Heimdal in the process. BTW, absolutely no offense meant toward Landon who maintains the Heimdal MacPort. Best regards, T.M.
On Apr 16, 2007, at 06:28, Tabitha McNerney wrote:
$ sudo su - postgres81
Whoops! That "su" is not the "su" you might be thinking of. That "su" is:
/path/to/macports/bin/su as in /opt/local/bin/su
installed by the heimdal port.
A bit unrelated to your question, but: I've seen others use "sudo su -" but I haven't understood it. Why not use "sudo -s"? Isn't that equivalent?
On Apr 16, 2007, at 14:14, Ryan Schmidt wrote:
On Apr 16, 2007, at 06:28, Tabitha McNerney wrote:
$ sudo su - postgres81
Whoops! That "su" is not the "su" you might be thinking of. That "su" is:
/path/to/macports/bin/su as in /opt/local/bin/su
installed by the heimdal port.
A bit unrelated to your question, but: I've seen others use "sudo su -" but I haven't understood it. Why not use "sudo -s"? Isn't that equivalent?
sudo su - will reset the environment entirely, whereas sudo -s won't necessarily do so. You -can- configure sudo to do the approximate equivalent, but that's not the default behavior: landonf@timor:~> sudo -s root@timor:~> echo $HOME /Users/landonf As for the original problem, heimdal should probably place it's binaries somewhere like: ${prefix}/libexec/heimdal or ...? I tried to get heimdal to prefix all binaries with 'k' a while ago, but never finished. Providing a different path seems preferable, given that some people will want the binaries first in their PATH. -landonf
On Apr 16, 2007, at 11:14 PM, Ryan Schmidt wrote:
A bit unrelated to your question, but: I've seen others use "sudo su -" but I haven't understood it. Why not use "sudo -s"? Isn't that equivalent?
In addition to what Landon said, you might also end up with a different shell, sudo -s takes $SHELL whereas sudo su takes what you se[et] via 'chsh' when logged in as root. Regards, Elias
2007/4/17, Elias Pipping <pipping@macports.org>:
On Apr 16, 2007, at 11:14 PM, Ryan Schmidt wrote:
A bit unrelated to your question, but: I've seen others use "sudo su -" but I haven't understood it. Why not use "sudo -s"? Isn't that equivalent?
In addition to what Landon said, you might also end up with a different shell,
sudo -s
takes $SHELL whereas
sudo su
takes what you se[et] via 'chsh' when logged in as root.
Hi, I believe "sudo -i" does exactly the same as a "sudo su -". Regards, Didier.
On Apr 17, 2007, at 8:59 PM, Didier Arenzana wrote:
Hi, I believe "sudo -i" does exactly the same as a "sudo su -".
Regards, Didier.
Close, but there's still a difference: $sudo -i #env SHELL=/bin/sh TERM=screen USER=root SUDO_USER=pipping SUDO_UID=501 PATH=/bin:/sbin:/usr/bin:/usr/sbin PWD=/var/root SHLVL=1 SUDO_COMMAND=/bin/sh HOME=/var/root LOGNAME=root SUDO_GID=501 _=/usr/bin/env is different from $sudo su - #env SHELL=/bin/sh TERM=screen USER=root PATH=/bin:/sbin:/usr/bin:/usr/sbin PWD=/var/root SHLVL=1 HOME=/var/root _=/usr/bin/env because in the former, the variables below are set, too: SUDO_USER=pipping SUDO_UID=501 SUDO_COMMAND=/bin/sh LOGNAME=root SUDO_GID=501 Regards, Elias Pipping
participants (5)
-
Didier Arenzana
-
Elias Pipping
-
Landon Fuller
-
Ryan Schmidt
-
Tabitha McNerney