sudo blocks aliases

alex radsky at ncia.net
Thu Dec 29 18:35:51 UTC 2005


For several years, I've been using aliases like the following in all
the linuxes that I've used.

alias xpa+='mount -t vfat /dev/hda1 /mnt/da1; cd /mnt/da1; ls -aF'
--color=auto'
alias xpa-='cd; umount -l /mnt/da1'

These two and several others are stored in /root/.bashrc.

I'm having a problem with these aliases in ubuntu because of 
sudo...I can't execute them from /root/.bashrc with or without sudo.

In other Linuxes, all I have to do is type ... xpa+  or xpa- and I have
access to Windows or in similar fashion,  can access other Linuxes.
For example, I have three ubuntus installed and can cross access them
except from one of them. (Two of the ubuntus have sudo disabled)

If try executing by typing them directly and executing in terminal mode,
I still have to modify them by adding sudo to each section like this

alias xpa+='sudo mount -t vfat /dev/hda1 mount /da1; sudo cd /mnt/da1;
sudo ls -aF --color=auto'
alias xpa-='sudo cd; sudo umount -l /mnt/da1'

They still don't work if I use this form in /root/.bashrc.

I could disable sudo but for this one ubuntu, I prefer not to.

Alas, What to do?  

alex





















More information about the ubuntu-users mailing list