Ubuntu :: How To Use Sudo In A Startup Script File

Sep 29, 2010

I am using a headless server with virtualbox installed on it. A second box is a LAMP server from which I have phpvirtualbox installed to give me a remote connection to the headless server. In order to get a connection made between the 2 boxes I need to start a program called vboxwebsrv, this being on the headless box. I therefore need to ssh into the server and startup the program. What I'd like to do is have this program launch on startup, and the folks at phpvirtualbox has a sample script available that will do that. Unfortunately the script uses a su command, not sudo. Since I am using Ubuntu, the su command doesn't work, but using sudo requires a password response. How do I deal with this?

Here's a snippet from the script:

# Function that starts the daemon/service
#
do_start()
{
if [ "$VBPID" != "" ] && [ "$VBPID" -gt 0 ]; then

[code]...

What I currently do is: sudo /usr/bin/vboxwebsrv -b --logfile /dev/null >/dev/null.(The script file sets up the path earlier on).What I don't want to do is have any interaction during startup, and frankly, I can't see how to avoid the password thing.

View 5 Replies


ADVERTISEMENT

Ubuntu :: Sudo - Add A Program To Startup Menu

Jan 6, 2011

I need to add a program to my startup menu (webserver which needs sudo for port80). I follow their directions, but it breaks the program and no pages are served. I will not be home to guide wife and kids every time they boot the machine to sudo start the program. How do you start a program at boot, as root or sudo start.

View 2 Replies View Related

Ubuntu :: Making Program To Load With Sudo On Startup?

Feb 2, 2010

I cannot figure how to make a program start-up when Ubuntu boots. I want the "sudo firestarter" command to run so the firestarter icon appears in the panel.

View 7 Replies View Related

Debian :: Add 'sudo-ed' Command On Startup?

Sep 21, 2010

what is the easiest way to add single command to startup? (has to be run as root)

View 1 Replies View Related

Fedora :: Where SUDO File At / Add Myself As A SUDO'er?

Oct 11, 2009

Where is the SUDO file at, and remind me how do I add myself as a SUDO'er?

View 3 Replies View Related

General :: Startup - Automate "sudo Chmod A+r /dev/usb/hiddev0" Upon Start?

Oct 22, 2010

I have a footpedal and fortunately there is a software for using it under linux (see [URL]). The author of that software already solved an issue for me (see issues there), but there is no option to ask simpler questions.

Unfortunately prior to use the software I have to change the device permission each time I start linux. How could I change that to be done automatically at startup?

View 4 Replies View Related

Ubuntu :: Can't Remove File With Sudo?

Feb 23, 2010

I have this nasty file that eats away my very soul, since I can not remove it.When I try the following I get this output:

Code:
sudo rm -rf 1
rm: cannot remove directory `1': Directory not empty
Code:
ls *
ls: cannot access the filename png: No such file or directory
Code:

[Code]...

View 3 Replies View Related

Ubuntu :: Sudo Broken - No Such File Or Directory

Mar 15, 2010

In Ubuntu 9.10, sudo was working properly except it would not let me run speedy as sudo. I would get an error message, which I believe stated "No such file or directory. However, I could run the command as my regular user (being prompted it needed escalated privileges), and I could run the user as root. So I tried to "fix" it so that I could run it via the sudo command. My fix, in turn, ended up breaking sudo. I edited a file which contained the directories for PATH (I made a backup of said file), and that didn't work. It further broke sudo. So I attempted to restore the backup file, however, sudo was still just as broken.

Now, whenever I try to execute any command with sudo I get:
tim@linux-hp:~$ sudo -i
[sudo] password for tim:
env: -i: No such file or directory
tim@linux-hp:~$ sudo gedit
env: gedit: No such file or directory
tim@linux-hp:~$ sudo apt-get update
env: apt-get: No such file or directory
tim@linux-hp:~$ sudo nautilus
env: nautilus: No such file or directory
tim@linux-hp:~$ sudo update-manager
env: update-manager: No such file or directory
tim@linux-hp:~$ sudo speedy deploy
env: speedy: No such file or directory

I have since upgraded to Ubuntu 10.04 Alpha 3, with mild hopes that the upgrade would remedy my problem, but alas - it did not. How to get sudo back to a working condition?

View 9 Replies View Related

Ubuntu :: Sudo: User Is Not In The Sudoers File

Mar 25, 2010

I get this message if i try to use sudo/gksudo. What causes this, how can I solve it? It has been working for years. If i remember correcttly there was a sudo update few days ago, maybe it doesnt work since then, i havent used it in the last few days.

View 9 Replies View Related

Ubuntu :: Sudo - Ramy Is Not In The Sudoers File

Dec 24, 2010

Whenever I try to run something as root using the sudo comand I get: Code: ramy is not in the sudoers file. This incident will be reported.

View 6 Replies View Related

General :: How To Get Name In Sudo File?

May 15, 2011

My OS is Linux Fedora 11.PC is IBM 1.8 GiB memory, Intel Duo E8500@3.1GHz.The modem I want to install is a USB stick from 'Cell C' the service provider.The code I got from the internet is for Ubuntu. I am new to Linux. When I type the code in at the Terminal, it tells me that Fdeb (my user login name) is not in the sudo file. How do i get my name in the sudo file?

View 2 Replies View Related

General :: Edit The Sudo File?

Apr 27, 2011

I need to have regular user run this command sync; echo 3 > /proc/sys/vm/drop_caches

but it requires root privileges that I cannot give.

So I figured they could run the command as "sudo". I looked in /etc/sudoers and wasn't sure what I needed to edit for the users to run the following command

sync; echo 3 > /proc/sys/vm/drop_caches

View 14 Replies View Related

Slackware :: Cant Execute File In /bin With Sudo?

Dec 28, 2010

I've created a firewall with iptables rules and saved them into my bin directory (then changed them to executable) However i cant use "sudo firewall-start" it just prints a whole heap of garbage. When i use the "sudo firewall-start" command as root, it works perfectly. Im sure there's a simple solution to this problem, but cant seem to find one in the forums.

View 5 Replies View Related

Ubuntu :: Sudo WGet Piped To TAR Has Wrong File Owner

Jan 4, 2010

I'm trying to download a file and extract it in one line, but the extracted file is owned by me instead of root even though I'm using sudo:
Code:
sudo sh -c 'wget [URL]'
If I don't try to extract the file, it is owned by root as I expected:
Code:
sudo sh -c 'wget [URL]'

View 1 Replies View Related

Ubuntu :: Open The File Manager By Command Line Using Sudo?

Apr 6, 2010

I would like to open the file manager by command line using sudo, but I just can't remember the name of it!! I can "almost" remember it... but it escapes me. And I am afraid I don't know where to look for it.

View 9 Replies View Related

Ubuntu :: Secure Copy: Overwrite Remote File With Sudo?

Mar 18, 2011

My situation:

Host A: need sudo to access the file
Host B: need sudo to access/overwrite the target file

How to copy a file from host A to host B without creating temporaries? Is it possible?

View 1 Replies View Related

Ubuntu :: Sudo Ifconfig Eth0 Down Vs Sudo /etc/init.d/networking Stop

Jun 10, 2010

explain the difference between these two commands. I'm currently reading about changing your mac address and both of these commands show up a lot. They sound like the same thing to me. Is one better than the other, or do you need to use both to change your mac address?

Code:
sudo ifconfig eth0 down
sudo /etc/init.d/networking stop

View 3 Replies View Related

Fedora :: Edit Sudo Config File

Mar 3, 2011

edit the sudo config file to allow my account to use some commands as a root.so can someone advise me how should i do it.

View 3 Replies View Related

General :: Input To Sudo - What Is Its File Descriptor

Aug 5, 2011

Where does input to sudo go? I mean when we give password to sudo prompt where it actually goes? If it goes to a file what is its name or what is its file descriptor?

View 1 Replies View Related

Ubuntu :: Sudo Aptitude Install Fbpanel / Can't Find Config File

Jul 9, 2010

I installed fbpanel with sudo aptitude install fbpanel, but I can't find the config file. according to the readme it's suppose to be under ~/.config/fbpanel/default, but it's not there. Where else can it be? I did a whereis fbpanel and it's located in a few areas, but no default config file is there!

View 3 Replies View Related

Ubuntu :: Creating A Text File To Start Up Sudo Bash Without Going To The Terminal?

Feb 26, 2011

I just set up apache on my PC and I cant change the permissions by right clicking because "I'm not the owner" and instead of using the chmod command on every file that I would like to edit I would just like to write a script on a text file, save it to my desktop so all I have to do is double click on it and boom I can edit all my files, etc.

View 2 Replies View Related

General :: Why Is My Sudo Generated File Owned By Root?

Jul 9, 2010

When I run '# sudo touch newfile' my expectation was that the file would be owned by me, not by root, as my understanding of sudo is that it is giving me, the user, root priviledges but does not actually switch the user.Do I have a fundamental misunderstanding of what sudo is about?

View 4 Replies View Related

General :: Sudo In .desktop File When Launching Graphical App

Feb 8, 2011

Fedora 14 i can run a program with another user with:

But:

it doesn't work, if i put the command in a .desktop file.

View 1 Replies View Related

Debian :: Sudo Results In Strange File Owner

Mar 16, 2010

I like the "Ubuntu" sudo philosophy and wanted to setup this sudo the same way on my Debian system. I was happy when I found that I just have to do the following:
-create a group 'admin'
-adduser christian admin
-visudo
-add the line: %admin ALL=(ALL) ALL

Then I tried sudo rm -rf / to check if sudo works. All worked fine. No, seriously, I can move around files that belong to the root and such, so sudo somehow works. But when creating new files with sudo, like e.g.
tar xzf myZippedTarball
these files belong to user 41034 and to the group users instead of root root:
drwxr-xr-x 7 41034 users 4096 2009-11-01 01:07 libsvm-2.9
Certainly, this is not the way I want to have. The user 41034 doesn't even show up in /etc/passwd...

View 2 Replies View Related

General :: Root (sudo) Can't Write To File It Created?

Mar 9, 2011

Debugging some of my scripts after upgrading from Debian Lenny to Ubuntu 10.04. In so doing, I tripped over this "problem," the solution to which may give me a clue to others.

On a bash shell command line I created a file thusly:

sudo touch zero_file

and it lists as expected with default permissions 0644:

-rw-r--r-- 1 root root 0 2011-03-09 11:18 zero_file

But then this command fails

sudo echo abcdef >>zero_file
-bash: zero_file: Permission denied

I can place the command (minus the "sudo") in a script & run it under the auspices of sudo & it works. Am I missing something re the stdin redirection when using sudo?

View 9 Replies View Related

General :: Trying Sudo MV Command On File - Permission Denied

Jul 17, 2010

If I try the sudo mv command on the file listed below I get the error listed. I am confused. It is my file & I have permissions. Somehow a slew of files on my system are now showing this way. This seems to correspond when I ran rsync from my netbook to sync it up with my desktop where I am having a problem.

Potential Source ->
sudo rsync -av --delete --rsh=ssh joe@192.168.1.4:/media/Abyss/Memories/ /home/joe/Pictures/

Type of issue ->
mv: cannot remove `100_2259.jpg': Permission denied

joe@Tux-Box:/media/Abyss/Memories/2009/3-09$ stat 100_2259.jpg
File: `100_2259.jpg'
Size: 243012 Blocks: 480 IO Block: 4096 regular file
Device: 811h/2065dInode: 1312030 Links: 1
Access: (0777/-rwxrwxrwx) Uid: (1000/joe) Gid: (1000/joe)
Access: 2010-07-17 11:41:26.708020712 -0400
Modify: 2009-12-13 21:49:59.501938000 -0500
Change: 2009-12-24 05:54:02.854309200 -0500

View 7 Replies View Related

Ubuntu :: Permission Denied - Fail At Sudo /usr/lib/nx/nxsetup - Install - Due To File Is Missing

Feb 28, 2011

I am installing ubuntu to amazon EC2 by following the steps at [url] The installation works fine.

Then I want to gain Remote Desktop Access to Ubuntu, so I follow [url]

However, fail at sudo /usr/lib/nx/nxsetup --install due to this file is missing.

I then use putty, navigate into /usr/lib/nx to run command below.

wget [url]

But, it always come out with permission denied issue

I also try to upload the .tar.gz file via winscp to any of the possible directories.

All fail with permission denied issue.

Permission denied.
Error code: 3
Error message from server: Permission denied
Request code: 3

View 1 Replies View Related

Software :: Pam_start Error 26 \ Use Sudo Su And Add An Account To A Group What's Allowed To Use Sudo?

Jan 2, 2011

I have a problem when I want to use su I get this error:Code:su: pam_start: error 26I have googled it so I found this topic (http://www.linuxquestions.org/questi...r-26-a-615024/) but it didn't really help me. There was a reply on that topic and his question was what the output of this was:

Code:
ldd /usr/bin/passwd
and

[code]....

View 4 Replies View Related

General :: Changing File Permissions Works As Root But Not As Sudo

Nov 22, 2010

I have a really strange problem. I have a few files in a large directory that I want to make readable by everyone. So I try this:

sudo find readme* -not -perm -o+r -exec chmod +r {} ;

and get this:

sudo: unable to execute /usr/bin/find: Success

I don't know why it says Success, because the permissions were not changed. I verified by typing this:

find readme* -not -perm -o+r -exec ls -l {} ;

and get something like

-rw------- 1 root root 536871076 Nov 22 14:06 readme_20101122200429
-rw------- 1 root root 536871892 Nov 22 14:08 readme_20101122200642
-rw------- 1 root root 293458128 Nov 22 14:10 readme_20101122200859

as a last resort, I tried:

sudo chmod +r *

and got:

sudo: unable to execute /bin/chmod: Success

and again Success really means fail. So, I gave up and logged in as root and tried:

find readme* -not -perm -o+r -exec chmod +r {} ;

This time it worked. Why?

EDIT: /etc/sudoers looks like:

## Allow root to run any commands anywhere
root ALL=(ALL) ALL
##Me
user1 ALL=(ALL) ALL

View 2 Replies View Related

Fedora Security :: Cannot Open /var/db/sudo After Sudo Package Upgrade?

Sep 16, 2010

A day ago I finally got around to upgrading the PackageKit installation that had been sitting for a week and a half, so I found a new upgrade for sudo available - the one that gives the sudoreplay command, I forget which version number it is exactly. When I try to use the sudo command I get this notice in my terminal:Code:Can't open /var/db/sudo/me/1: Permission deniedI didn't get it before. What do I have to do to make it open? I'm using SELinux in enforcing mode if that helps.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved