sudo

Running a file as nonroot from a root bash script

Okay, I currently use an eggdrop IRC bot on my server. I want to make a bash script to start it up as well as a few other scripts at the same time. All that's left is to make it start, but it won't run as root. However, I also need to be in the current directory of the file to run it, or it displays an error. For example: /home/eggdrop...

In my virtualenv, I need to use sudo for all commands

I set up a virtualenv, which is working, but for some reason I need to use sudo for commands as simple as mkdir. Obviously I did something incorrectly. Any idea what it might be? Thanks ...

Ruby on Rails Beta 3 Install Problem on Snow Leopard

Hello Friends, i tryed to install the new beta on my system with the command: sudo gem install rails --pre but no matter what i tryed, i still get this damn error: Successfully installed rails-3.0.0.beta3 1 gem installed Installing ri documentation for rails-3.0.0.beta3... File not found: lib Since im very very new t...

changed sudo path, command continues not being found

I added export PATH="/home/deltrem/Pedro - Arquivos/play/ps1/linux/pSX:$PATH" to /root/.bashrc , but sudo pSX echoes command not found. ...

using sudo with mercurial and ssh authentication

How do i run ssh-add key sudo hg clone [email protected]/etc/etc but use my ssh keys and not the superusers. Hey everyone, when i use sudo with for example, sudo hg clone [email protected]/etc/etc after i have added a key to my user account it doesnt work. I remember this is because the sudo is ran as the superuser but that user cannot h...

Unix: command for sudo-mv-chown combo?

I am operating as sudo in a system where I mv a great amount of files and dirs to and fro. Is there a command for the combo? $ sudo -i; # mv hello /home/other; # chown -R other:other /home/other/hello ...

Running shell scripts with sudo through my web app

I have some functionality that interfaces with the server's OS in my web application. I've written a bash script and am able to run it from within my app. However, some functionality of the script requires superuser privileges. What is the most sane way to run this script securely? It is being passed arguments from a web form, but shou...

Why running sudo to my own account fixes graphical problems in Swing GUI

My swing GUI application starts with a script. When I run that script under Linux without sudo it gives me unexpected Look and feel and other graphical problems. Why is running with sudo su to my own account fixes this problem? ...

What kind of API should I use to elevate user privilege to super-user in a Mac OS X?

I want to elevate my app's privilege to super-user. Installer app supports this by displaying this dialog. How can I show this dialog to elevate privilege? PS. I'm making a kind of packet sniffer application on Mac OS X. I'm using pcap lib. (which is part of tcpdump) ...

Is it safe to run a ruby script using sudo ?

I am running redmine on Ubuntu, and I am running it using sudo. If I try to run as my redmine user, I get permission errors on the log file. Is this safe? Should I be concerned? ...

How to call shell script from php that requires SUDO?

I have a file that is a bash script that requires SUDO to work. I can run it from the command line using SUDO but I will be prompted to put in the SUDO password. I want to run this script from php via shell_exec but I if I call SUDO, its not like a command line where I can be prompted for the password. Is there a way to pass the passwo...

Mac OS X Python GUI Administrator Prompt

I have an OS X Python application that uses wxPython for it's GUI controls. I'm looking to prompt the user for administrative rights (akin to using the Authorization Service API in Objective-C) before starting a network service. The closest library I have found is Bob Ippolito's Authorization library but it is fairly outdated and has co...

sudo in php exec()

I don't know what the deal is here… So I want to run an applescript: sudo osascript myscript.scpt it works fine in the terminal, however when I execute it via PHP's exec(), nothing happens. The console says no tty present and no askpass program specified ; TTY=unknown ; … I did my research, and it seems I'm missing the password for th...

Automatically invoking gksudo like UAC

This is about me being stressed by playing the game "type a command and remember to prepend sudo or your fingers will get slapped". I am wondering if it is possible somehow to configure my Linux system or shell such that when I forget to type e.g. "sudo apt-get install emacs", instead of just telling me that I did something wrong, gksud...

Why does ruby's '$:' or '$LOAD_PATH' change when I run it with sudo?

I am trying to run a ruby script as root. When I try to require a gem, ruby says it can't be found. This is because of $: $ ruby -e "puts $:" /opt/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.0.beta4/lib /opt/local/lib/ruby/gems/1.9.1/gems/cgi_multipart_eof_fix-2.5.0/lib /opt/local/lib/ruby/gems/1.9.1/gems/daemons-1.1.0/lib /opt/loc...

Why running Java UI without SUDO breaks GUI appearance?

Why running application with SUDO changes GUI appearance? I.e.Button background, Button size, JTree appearance are behaving differently depending on how the GUI was started with SUDO or not. Will appreciate your suggestions. Thank you ...

RVM and thin, root vs. local user

So I'm trying to get thin to run as a service with RVM. After a thin install I manually updated /etc/init.d/thin to use an su - user when running the config command so that thin was running as a local user, rather than root. So far so good. Now, when I try to sudo service thin start it looks like it's trying to use the non-RVM version o...

sudo in andLinux allows root access without password

Hi! While working under andLinux on a bash script that has to sudo some stuff, I arrived at the following line.. this line seems to provide root access but doesn't require a valid password: echo | sudo -S cat /etc/shadow >/dev/tty Can anyone explain why this happens? Without the 'echo |' or the '>/dev/tty' this doesn't work and reques...

Using Net SSH to execute commands with sudo

I've been trying to write a small library using Thor to help assist me in quick creating new projects and sites. I wrote this small method: def ssh(cmd) Net::SSH.start( server_ip, user, :port => port) do |session| session.exec cmd end end to just assist me in running quick commands on remote servers when needed. The proble...

How to run sudo command as root?

Hello, I only have root access to my server and the sudo command therefore does not work. I am trying to run a command that tries to use the sudo command and as I already have root access, it fails. command not found: sudo chmod +x /usr/local/bin/wkhtmltopdf Is there a way that I can get this command to run? Can I move out of roo...