Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 're: please see this...' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
re: please see this...
Authored by: jimr on Oct 17, '01 06:41:59AM

yeah,
aliases are part of the shell

so if you

[devlin:~] jim% sudo ll
Password:
sudo: ll: command not found

where ll is one of the default aliases


on the other hand,

if you perform some trivial operation like ls
then ask for an alias

it seems to work

sudo ls; ll

in this case, the ll is performed as superuser

also check
sudo ls; alias
sudo ls; env

to prove this to myelf, I made a file as root

-rw-r--r-- 1 root wheel 5 Oct 17 19:22 remove_file

then
sudo ls; rm remove_file

gone

alternatively
I have a shell alias which sets edit to "pico"

so if I
sudo edit <filename>

Password:
sudo: edit: command not found

however;

sudo ls; edit test_file


the file is still made/owned by me
-rw-r--r-- 1 jim wheel 16 Oct 17 19:31 test_file

but for rm it works

so ....

seems better just to su

and get your self logged as root.

copy your aliases over to the root folder

check this out

sudo -s

then type "env"

Trying to decide what that is...
probably related to the security thing

best to type sudo -k if you go away from your keyboard.






[ Reply to This | # ]