 |
 |
 |
 |
| Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum. |

17th March 2009, 07:22 AM
|
|
Registered User
|
|
Join Date: Dec 2008
Posts: 4

|
|
Shell Script
I am trying to run a Shell Scrip but I can't get beyond the root password. When I run the scrip, it promps the password and after I enter it, the scrip doesn't run  . Is there any way to redirect the scrip and make it run after entering the password?
|

17th March 2009, 09:56 AM
|
 |
Registered User
|
|
Join Date: Jun 2006
Location: Texas
Age: 42
Posts: 4,168

|
|
|
You may want to test it while in root. When done with it, you may move it to /etc/cron.daily or /etc/cron.hourly. Those are root access anyway, it won't ask you for root password.
Mind show what the script looks like now? Might have a better idea.
|

17th March 2009, 10:01 AM
|
|
Registered User
|
|
Join Date: Jan 2006
Location: Denver, CO USA
Posts: 670

|
|
you can bypass the root password prompt altogether by setting yourself up in sudoers with no password required. Then, in the script, run the script as sudo.
First, as root, run visudo and remove the # from the beginning wheel group entry.
Code:
# %wheel ALL=(ALL) NOPASSWD: ALL
Second, as root, make sure you are part of the group wheel.
Code:
usermod <username> -G wheel
(or do it in the Users and Groups option from the System->Administration option)
Third, edit your script to run the command as sudo. So if in your script you have a command needed to be run as root:
Code:
command-with-root-required
change it to:
Code:
sudo comman-with-root-required
davidj
|

17th March 2009, 03:44 PM
|
|
Registered User
|
|
Join Date: Dec 2008
Posts: 4

|
|
|
Hi there
Here is the scipt:
if [ ! -d /proc/bus/usb ]; then
modprobe usbcore >/dev/null 2>&1 && mount -n -t usbfs /proc/bus/usb /proc/bus/usb -o devgid=502,devmode=664
else
mount -n -t usbfs /proc/bus/usb /proc/bus/usb -o devgid=502,devmode=664
fi
|

17th March 2009, 04:41 PM
|
 |
Registered User
|
|
Join Date: Jun 2006
Location: Texas
Age: 42
Posts: 4,168

|
|
Throw that file into /etc/cron.hourly directory.
May sure the first line contains:
|

17th March 2009, 05:15 PM
|
|
Banned
|
|
Join Date: Jun 2008
Posts: 1,315

|
|
Quote:
Originally Posted by Invernizzi
Hi there
Here is the scipt:
if [ ! -d /proc/bus/usb ]; then
modprobe usbcore >/dev/null 2>&1 && mount -n -t usbfs /proc/bus/usb /proc/bus/usb -o devgid=502,devmode=664
else
mount -n -t usbfs /proc/bus/usb /proc/bus/usb -o devgid=502,devmode=664
fi
|
Why don't you try with beesu?
yum install beesu
Code:
#!/bin/sh
if [ ! -d /proc/bus/usb ]; then
beesu - "modprobe usbcore >/dev/null 2>&1 && mount -n -t usbfs /proc/bus/usb /proc/bus/usb -o devgid=502,devmode=664"
else
beesu - mount -n -t usbfs /proc/bus/usb /proc/bus/usb -o devgid=502,devmode=664
fi
it'll run as root asking to you to enter your root password
bye!!!!!!!!!
|

18th March 2009, 01:14 AM
|
 |
Registered User
|
|
Join Date: Aug 2005
Location: Ann Arbor
Age: 45
Posts: 3,907

|
|
Quote:
|
you can bypass the root password prompt altogether by setting yourself up in sudoers with no password required. Then, in the script, run the script as sudo.
|
talk about opining up a security hole .
if you do that you might as well turn off SElinux and turn off the firewall and turn on remote access ( seeing as there will be NO password needed to zombie your computer
bee that should be closed source or shareware with the amount of advertising you do for it .
before you know it we will see an add pop up on " google/linux " for it .
but then again i do not like sudo to begin with
Last edited by JohnVV; 18th March 2009 at 01:19 AM.
|

18th March 2009, 03:34 AM
|
|
Registered User
|
|
Join Date: Dec 2008
Posts: 4

|
|
|
thanks guys for the reply. What Bee says works best for what I was looking for. John VV what U mean with Google/Linux??
|

18th March 2009, 03:49 AM
|
 |
Registered User
|
|
Join Date: Aug 2005
Location: Ann Arbor
Age: 45
Posts: 3,907

|
|
Quote:
|
John VV what U mean with Google/Linux??
|
this
http://www.google.com/linux
h??p://www.google.com/linux
it filters for "linux " only
|

18th March 2009, 12:07 PM
|
|
Banned
|
|
Join Date: Jun 2008
Posts: 1,315

|
|
|
|

18th March 2009, 05:46 PM
|
 |
Registered User
|
|
Join Date: Aug 2005
Location: Ann Arbor
Age: 45
Posts: 3,907

|
|
|
beesu is nice , i just do not like sudo to begin with .
|

18th March 2009, 05:49 PM
|
|
Banned
|
|
Join Date: Jun 2008
Posts: 1,315

|
|
Quote:
Originally Posted by JohnVV
beesu is nice , i just do not like sudo to begin with .
|
Thank you!!!!!!
bye!!!!!!!!!!
|

18th March 2009, 06:49 PM
|
|
Registered User
|
|
Join Date: Jul 2005
Posts: 591

|
|
Quote:
Originally Posted by JohnVV
beesu is nice , i just do not like sudo to begin with .
|
I agree, I suppose it has practical applications in shared environments. Actually, the most useful thing I've used sudo for was granting a normal user access to specific binaries but NOT giving them or myself blanket root access.
I really don't understand the recent trend to use sudo by default. I understand Ubuntu does things like this but if I intend on doing some serious system work I just log in as root from the terminal....
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Current GMT-time: 02:00 (Sunday, 19-05-2013)
|
|
 |
 |
 |
 |
|
|