Re: How to detect Debian systems w/o root passwd ?
On Fri, Sep 04, 2009 at 06:11:53PM +0200, Christian Perrier wrote:
> Quoting Bill Allombert (Bill.Allombert@math.u-bordeaux1.fr):
> > Dear Debian boot,
> > It is now possible to set up Debian system without a root password.
> > On such system sudo must be used instead of su.
> > What is the canonical way to detect such situation ?
> > My purpose is to change su-to-root to automatically default to sudo mode
> > on such system.
> CC'ing you , assuming you're not subscribed.
Thanks for your answer, especially since you maintain shadow.
> I'd say that reading the value of passwd/root-login debconf template
> is the safest way. If you get "false", then the system is a sudo-only system.
I assume the code below should work ?
debconf-show passwd 2>/dev/null |grep -q 'root-login: false'
> Of course, that will tell you what you need only when the rootless
> system has been installed by choosing the appropriate option in D-I.
Is it possible to get this information from PAM instead?
Imagine a large red swirl here.