PDA

View Full Version : Playing with .bash_aliases



hari.iiitb
June 4th, 2010, 06:09 PM
Hi,

I wanted to create an Alias, so that when I type 'c' in Terminal, C drive should be mounted and opened.

Here is what I did.

alias c='sudo -n mkdir /media/C; sudo -n mount -t ntfs /dev/sda1 /media/C; cd /media/C; nautilus .;exit'

I thought sudo -n would not ask me for password prompt and feed in my password by itself. But I thought wrong. How could I feed in the password automatically to the sudo command?

drpjkurian
June 4th, 2010, 06:13 PM
You could also configure sudo with visudo to allow you user to use make as sudo without password.

User_Alias USERS = your_user
Cmnd_Alias CMDS = /usr/bin/make
USERS ALL = (ALL) NOPASSWD: CMDS

hari.iiitb
June 4th, 2010, 08:02 PM
Hi, I added your thing into my /etc/sudoers.tmp.

But still when I do sudo su, it is asking for password