[blfs-support] Su and Sudo--Getting Both to Work

Dan McGhee beesnees at grm.net
Mon Dec 2 17:06:08 PST 2013


On 12/02/2013 05:20 PM, Bruce Dubbs wrote:
> Dan McGhee wrote:
>
>> I reset root's password and then realized I, when I tried to run su, may
>> have been misleading in this post. The actual return I get is:
>>
>> Crypt: Invalid argument
> This is what I get:
>
> $ su
> Password: badpw
> su: Authentication failure
>
> So I suspect some other issue.  What do you get with 'ldd /bin/su'?
>
> $ ldd /bin/su
>           linux-vdso.so.1 (0x00007fff4c5cf000)
>           libcrypt.so.1 => /lib/libcrypt.so.1 (0x00007f87f269d000)
>           libc.so.6 => /lib/libc.so.6 (0x00007f87f22f3000)
>           /lib64/ld-linux-x86-64.so.2 (0x00007f87f28f1000)
>
> /etc/passwd should have:
>
> root:x:0:0:root:/root:/bin/bash
>
> and /etc/shadow should have:
>
> root:$6$xxxxxxPwHashxxxxxxxxxxxxxxxxxxx:15010:0:99999:7:::
>
> There should be no punctuation in the hash other than / or . or $
>
>     -- Bruce
>
Looks like this could be a stumper. Here are the commands and their outputs:

> $ ldd /bin/su
> linux-vdso.so.1 (0x00007fffefb80000)
> libcrypt.so.1 => /lib/libcrypt.so.1 (0x00007f1ccdf50000)
> libc.so.6 => /lib/libc.so.6 (0x00007f1ccdba0000)
> /lib64/ld-linux-x86-64.so.2 (0x00007f1cce188000)
>
> $ cat /etc/passwd | grep root
> root:x:0:0:root:/root:/bin/bash
>
> $ cat /etc/shadow | grep root
> root:$6$xxxxxx.xxxxxxxxx.[a bunch more stuff].:16041:0:99999:7:::

What's quite ironic is--I just discovered this--when I run "sudo su" the 
id shifts to root without my having to enter a password. I don't know 
what's easier 'sudo su <Enter>' or 'su <Enter> type password <Enter>' :)

Seriously, if there is something not right, I'd like to fix it or know 
that I can't.

Dan





More information about the blfs-support mailing list