shell script problem , sudo mount command


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting shell script problem , sudo mount command
# 1  
Old 08-19-2009
shell script problem , sudo mount command

cat test.sh
Code:
sudo mount -t vfat /dev/sda7 /media/Ddrive

If i double click the test.sh file and select run in terminal then the terminal prompts for password.
How can i avoid typing password?

Or if i double click test.sh file and select run then nothing happens.

What i'm trying "Double click and mount the partition"
Using ubuntu.
# 2  
Old 08-19-2009
If you want to not have to supply a password, you need to change your sudoers file.

Code:
username ALL=/sbin/mount

That should do it, otherwise try:

Code:
username ALL=/sbin/mount -t vfat /dev/sda7 /media/Ddrive

# 3  
Old 08-19-2009
Thank you.
Un-commenting # %sudo ALL=NOPASSWD: ALL it also works.
# 4  
Old 08-19-2009
Kind of a security risk... but whatever floats your boat
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Problem with command mount

Hi, I have a problem with the command mount with a password with special character mount -t smbfs '//itransfert_cs:password@IP/itransfert/1-Arrivees/Vers_K2' /share the password contain a * and a @ I try to quote but don't work, replace the @ with %40 and try to escape with \ but... (8 Replies)
Discussion started by: protocomm
8 Replies

2. Shell Programming and Scripting

Problem with expr command in shell script

Hi, I have used expr command to increment the date. for e.g., case 1 : echo $(date -d $(echo `expr 20010101 + 1`)) it returns Tue Jan 2 00:00:00 IST 2001 case 2: echo $(date -d $(echo `expr 20010101 - 1`)) it returns date: invalid date `20010100' please suggest me, how to... (3 Replies)
Discussion started by: nanthagopal
3 Replies

3. Shell Programming and Scripting

Help with Shell Script on sudo

I want to execute a script(generateReport.sh) which resides on root home directory from shell script(localtrigger.sh) as root by using sudo. The thing is i cant edit /etc/sudoers (i can but m not allowed to do it , ethically) i cant change ownership of generateReport.sh script When i try... (7 Replies)
Discussion started by: saket
7 Replies

4. Shell Programming and Scripting

Problem using cut command in shell script

I'm new to shell programming, and am having a problem in a (Korn) shell program, which boils down to this: The program reads a record from an input file and then uses a series of "cut" commands to break the record into parts and assign the parts to variables. There are no delimiters in the... (2 Replies)
Discussion started by: joroca
2 Replies

5. Shell Programming and Scripting

Problem Executing Firmware Command using Shell Script

Guys, I have a script that should change one of the configuration Parameter in a http accelerator, this config change which will halt http traffic into device. So I have designed a script which should do these changes. But after executing this script, found that one of the input variable is not... (8 Replies)
Discussion started by: raghunsi
8 Replies

6. Shell Programming and Scripting

problem in exit status of the command in a shell script-FTP

Hi All, I have developed below script for FTP a file from unix machine to another machine. ftpToABC () { USER='xyz' PASSWD='abc' echo "open xx.yy.zbx.aaa user $USER $PASSWD binary echo "put $1 abc.txt" >> /home/tmp/ftp.$$ echo "quit" >> /home/tmp/ftp.$$ ftp -ivn <... (3 Replies)
Discussion started by: RSC1985
3 Replies

7. Shell Programming and Scripting

Problem with MV command in Shell Script

Hi Guru's, I 'm trying to execute the below given script in Unix. I am having an issue with the script. The output of the script is given below: #!/bin/bash File_Home="/home/essftp/Risk" cd /home/essftp/Risk rm -f FileList rm -f credit_risk* file1=`ls -lt... (4 Replies)
Discussion started by: ranjith_taurean
4 Replies

8. UNIX for Advanced & Expert Users

Sudo command problem

Hi All, I am tring to redirect mails comming to my user id to a script. In other word trigger a script when a mail comes to my user id. Actually , Admin team has done all this to me previously. in my script i am doing like /usr/local/bin/sudo -u parbrxs /export/home/parbrxs/bin/parbrxs.sh... (4 Replies)
Discussion started by: mindtee_abhi
4 Replies

9. Shell Programming and Scripting

problem with sudo su and .sh script

here is my script: #!/bin/sh cd /Users/a echo "what is the name of the file u want?" read var1 var1=$var1... (1 Reply)
Discussion started by: cleansing_flame
1 Replies

10. Shell Programming and Scripting

problem with sed command in shell script.

Guys, I've a problem in the "sed" command used in my shellscripts This is the problamatic line in my shell script: sed -e 's/${line1}/${line1_m}/g' prod_hier_1234.txt > test.txt It doesn't do the job of replacing the string stored in variable 'line1' to 'line1_m'. However If I replace the... (10 Replies)
Discussion started by: bhagat.singh-j
10 Replies
Login or Register to Ask a Question