Setting the root password, (bash_completion <-> sudo)

Fábio Macêdo Mendes niels_bohr at uol.com.br
Fri Sep 17 18:35:13 UTC 2004


Paul Sladen wrote:

>On Fri, 17 Sep 2004, Tristan Rhodes wrote:
>  
>
>>>I suppose he's talking about bash autocompletion feature, if you want to
>>>execute root commands with sudo
>>>      
>>>
>
>I have bash_completion turned on for sudo and the like;  it completes on the
>basis of /sbin/:/usb/sbin:/usr/local/sbin (the path that you would have
>setup if you were root) and exactly like you'd expect.  If bash_completion
>isn't on by default it would probably be worth enabling /just/ the sudo
>specific code to keep people happy and comfortable using sudo
>  
>
we can make sudo be a script that points to the real sudo and program 
bash programable completion in /etc/bash_completion or 
/etc/bash_completion.d/ to complete commands that would be in sbin 
paths. The sudo script is very simple:

#!/bin/sh
export PATH=/sbin:/usr/sbin:$PATH
sudo.real $@

The autocompletion would be a little harder to get, but I guess we can 
work it out (any bash programmers here?). We would need to enable the 
programable completion feature for all users (including root?), which, 
IMHO is very handy. I just copied the files  /etc/bash.bashrc and 
/etc/profiles from knoppix which has all bash fancy features working by 
default.

-Fabio




More information about the ubuntu-users mailing list