sudo - Execute a command with superuser privileges.

learn more… | top users | synonyms

3
votes
2answers
193 views

insert text in a file using echo command [duplicate]

I am trying to insert some text in a file in the following way sudo echo "abc-abc/abc/abc" >> /etc/portage/make.conf but it give me the error Permission denied although I am using sudo ...
2
votes
1answer
552 views

Poweroff or Reboot as normal User

To run the command poweroff or reboot one needs to be super user. Is there anyway I can run this as a normal user? I just don't want to sudo and enter my password every time I reboot or power off.
4
votes
1answer
220 views

RPM fails to uninstall using sudo rpm -e

I have encountered a strange and annoying problem when trying to uninstall certain in-house generated rpm packages using sudo. When I do the following: sudo rpm -e mypackage rpm -qa | grep ...
12
votes
1answer
619 views

How can I `alias sudo !!`?

I'm trying to set an alias for sudo !! in Bash. I tried alias sbb='sudo !!', but it interprets that as a literal !! and prints sudo: !!: command not found If I use double quotes, it substitutes ...
0
votes
1answer
112 views

Are there any Linux distros that protect against “self-mutilation”? [closed]

Over the past week I have installed and reinstalled Linux several times (Mint 15 in all but one case; Ubuntu 13.04 is too slow on my laptop), and after a mishap with QT today I completely gave up in ...
0
votes
1answer
136 views

Execute remote programs and completely detaching it

I need to execute a remote application (named ConnectionManager), which uses the ncurses library, on the remote server launching it from a local pc. ConnectionManager is a program wich use ncurses ...
7
votes
3answers
509 views

Uncover sudoer user with root privileges which ran command X?

I'm the main sysadmin of a system. In the system there are 3 sudoers users with root's privileges. The system runs a script in background which check the hash of system's utilities to detect possible ...
2
votes
1answer
494 views

sudo hangs when run on remote host over ssh in a script without tty (-t)

I have an AIX 6.1 server where I need to run a remote sudo command in a bash script. Here is my bash script simplified: testSudo.sh #!/usr/bin/bash set -x sudo env I can run the sudo command ...
1
vote
2answers
124 views

Staggering the authentication delay on failed `su` or `sudo` [duplicate]

I'm about to start my new job as a sysadmin and I've been thinking about implementing a cooldown feature on su or sudo. The cooldown prevents the user from using these commands for a few seconds after ...
2
votes
2answers
1k views

How to make `sudo` preserve $PATH?

I need to run a program installed on /opt/godi/sbin (a custom directory). If I add that directory to my PATH, by adding the following line to my .bashrc file export ...
2
votes
2answers
3k views

Run a sudo (or startup) python script from cron on a Raspberry Pi?

I'm helping out with an art project (http://stargateeggbeater.com/ for those interested) built on Raspberry Pi. The RPi controls an addressable LED strip through the GPIO, using the spidev device per ...
2
votes
2answers
1k views

How can I mimic `sudo su - user` in a script?

I need to deploy my app to server called lovelyplace by a Fabric script. Unfortunately, the server's setup is horrible, but I can do nothing about it - I have to live with it. There is one non-root ...
0
votes
1answer
640 views

Why does NOEXEC not prevent the specified program from running?

I have tried the NOEXEC in my CentOS6.4 I have edited my /etc/sudo.conf file as below : Path noexec /usr/libexec/sudo_noexec.so and /etc/sudoers: ssh ALL=(root) ALL,NOEXEC:/usr/bin/passwd I am ...
0
votes
2answers
125 views

How can I run a linux build on an NTFS drive?

I'm running under Ubuntu but using a shared drive which is NTFS formatted. I've got blender sitting in a folder (it's the 2.66RC build with some trivial python customisations.) I'm calling blender ...
2
votes
1answer
2k views

sudo: ulimit: command not found

I was using ubuntu 12.04 ,on which I run ulimit -n ,it is showing 1024, I want to increase my open file limit from 1024 to 65535,so I tried the following command: sudo ulimit -n 65535 but i get the ...
0
votes
2answers
637 views

Ubuntu : unable to copy file to dir created under same credentials

I am Windows 7 remoting to Ubuntu 12.04.2 LTS I am new to Ubuntu ( and *nix in general ) and need to understand how permissions are assigned to newly created dirs. Via Putty ssh session : $bash ...
0
votes
2answers
59 views

Have rights during shell but not in a script (unless I sudo it)

I have a really basic confusion. How does sudo work? I noticed that when I ran a script it failed, since it tried to write a file in a directory that the following permissions: $ ls -l thedir ...
1
vote
1answer
547 views

use net instread of cdrom. linux, aptitude install

Got debian installed finally but during install I think I choose to use the local media over the internet for packages. needed to do that as was not sure if will try to connect right away (my modem ...
2
votes
3answers
2k views

How to send to background a running process started with sudo?

I have just installed SLC6 (derived from SL6 derived from RHEL6). I can send a running process to the background by hitting Ctrl-Z in the terminal where it was started. However, I can't do it when I ...
1
vote
1answer
55 views

How do I isolate my file system data from another system root?

I have a linux machine(kubuntu 13.04) A my friend asked me give him an account with being able to use sudo. So, I made an account for him and put the account in /etc/group for him to use sudo I don't ...
3
votes
1answer
1k views

Graphically ask for password in a bash script and retain default sudo timeout setting

The sudo -A (SUDO_ASKPASS) option apparently causes sudo to lose the timeout (e.g., timestamp_timeout) setting. I want to use the sudo -A option but I want to retain the default timeout (e.g., 15 ...
-1
votes
1answer
344 views

How to install kdesudo in OpenSUSE 12.3

I'm hoping this is a stupid question with a simple answer, but I've been hunting around for half an hour and cannot find a way to install kdesudo in OpenSUSE 12.3. I need to use kdesudo because kdesu ...
3
votes
1answer
271 views

Is it a bad idea to add myself to the sudo group?

Members of the sudo group in my Debian install can execute anything without entering a password. This is convenient, but seems like a bad idea. NOTE: My computer is an ordinary desktop, not a server ...
2
votes
1answer
311 views

sudoers: NOPASSWD in same line as PASSWD:ALL?

Is this combination legal: username ALL=(ALL) NOPASSWD: /usr/bin/foo, PASSWD:ALL or do they conflict or cancel each other out?
1
vote
2answers
1k views

How can I scp a file that my user can't read but I can sudo?

Can I use scp to copy a file from a remote server which my login user can't read, but where I have permission to sudo to root (without password even)? How?
2
votes
2answers
3k views

How to run sudo commands remotely via ssh -t?

I have a script that logs into a remote host via ssh -t and uses sudo service foo restart. The requirement is to avoid the prompt for a password on the remote host. The remote host authenticates via ...
6
votes
2answers
969 views

/etc/sudoers - Insults - How to add a list of insults?

I intend to play with the linux insults and add a few. However, i only could figure how to add a single insult but not a list or the location of the file that contains the insults.
5
votes
2answers
1k views

How can I cd into a directory as root?

Let's say there's a directory that I don't have the privileges to access. Obviously sudo cd foo won't work, because cd is a shell builtin in every shell ever. So far, I've just been using sudo bash ...
44
votes
3answers
2k views

How do the internals of sudo work?

How does sudo work internally? How is it possible that it can become root without having the root password, unlike su? What syscalls, etc. are involved in the process? And why is however sudo does it ...
3
votes
1answer
295 views

sudo command executes without prompting for password

For some reason, I suddenly do not need to enter the password when issuing sudo some_cmd. Entered command just runs without ever prompting password, even if I am not logged in as user root. Commands ...
-1
votes
1answer
160 views

How do i change the password for root using webmin, where i have no more access as root?

I changed the root password, using webmin it shows me successfully done. $ uname -a Linux .com 2.6.18-194.11.4.el5 #1 SMP Tue Sep 21 05:04:09 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux $ echo -e ...
10
votes
2answers
11k views

How to disable requiretty for a single command in sudoers?

I want to disable requiretty so that I can sudo within scripts, but I'd rather only disable it for a single command rather than everything. Is that possible within the sudoers config?
2
votes
1answer
807 views

How to execute php file as different user securely?

I want to confirm that my thoughts are correct as this is about security matter. We have web based application which is using db2 database. db2 runs under the db2inst1 user. Now we want users of the ...
1
vote
1answer
835 views

Running program as root without using sudo with normal user account

Is there a way to force to run program as root (with normal user) when there's no sudo on the machine (and can't be added)?
3
votes
2answers
579 views

Programatically use visudo to edit sudoers?

I have a sudoers file stored in our svn repo. I want to svn export it to /etc/sudoers but can't do it because sudo detects that it was not edited by visudo and throws syntax errors. What exactly does ...
3
votes
5answers
474 views

Protect folder from sudoers

Is there an ability to not allow sudoers view your folder (only you and root can access folder)?
2
votes
1answer
455 views

Why do programs run with sudo not have system theme applied?

I am currently running Linux Mint 14 - Mate Version and I have noticed that whenever I run a program with sudo, the system applied GTK theme(applied in "Appearance") does not work properly. Therefore ...
1
vote
1answer
380 views

Can't edit /proc/sys/net/core/wmem_max [duplicate]

Recently my wireless network has being stopping to transfer data from some irregular time intervals that vary from 30 seconds to 20 minutes, and every time I need to plug off and then on the wireless ...
3
votes
2answers
2k views

Allow a specific user or group root access without password to /bin/date

As the title would suggest, I'd like to give a user or group full root access to the /bin/date command, including any manner of arguments as defined in the man pages. I understand /etc/sudoers ...
0
votes
1answer
361 views

How to start a GUI program with PHP from website

My firm has some Ubuntu 12.04 running where there is no display attached and that are behind different firewalls. The visitor on local websites on that servers should be able to start a GUI program ...
0
votes
0answers
71 views

How to start a GUI program in a VM with PHP

I have an Ubuntu 12.04 VM running on my online server where there is no display attached. I want to start Teamviewer there on that VM to get graphical access to that server. I guess I have to give ...
3
votes
1answer
85 views

Remember password after `sudo -i`

If I do sudo <command> and enter the password, my Debian Squeeze remembers the fact I passed the password and never asks for it for i.e. 15 minutes. But if I do sudo -i and then exit, the ...
1
vote
3answers
326 views

SUDO: Username condition in sudoers file

I'm trying to allow my user (via sudo, launched in a script) to copy a file from their home to a web directory. Command would be: sudo cp /home/$LOGNAME/file_source /var/www/$LOGNAME_file_dest So ...
3
votes
1answer
2k views

Stop su from asking for a password

I am trying to run the following command as deploy from Java (the JVM is running as the user tomcat): sudo -u deploy /path/to/my/bash/script.sh PARAM1 PARAM2 My sudoers file has the following in ...
14
votes
2answers
791 views

How long is the password for executing a command with sudo cached?

If I run a command which requires root privileges with sudo, I will be asked to enter the current user's password. After that for a while, if I execute the same sort of commands with sudo, I won't be ...
2
votes
2answers
305 views

Command added to visudo still is failing on permissions?

My sudo file has two commands in it right now that are allowed to run without logging in as root. It looks like this: user ALL=(root) NOPASSWD: /home/user/prog1.py user ALL=(root) NOPASSWD: ...
3
votes
1answer
590 views

sudo: unable to initialize PAM: No such file or directory

While trying to build the NumPy Python math module with Intel's Math Kernel Library (MKL) on OSX 10.8.3, I was running into some problems with the Accelerate and vecLib frameworks overriding the MKL. ...
0
votes
2answers
370 views

TAB autocomplete on sudo sh

When I say sudo sh, TAB stops working as autocomplete signal on my Debian. How can I enable TAB key autocomplete after I say sudo sh ?
2
votes
0answers
1k views

How to run ssh -t user@remote 'sudo nohup bash -c “comand”' in background

I want to run a script on a remote host with sudo privilege, someone suggests that I should use nohup and ssh -t, like the following command: The script ls; sleep 10; echo finish is crafted here to ...
4
votes
1answer
152 views

when timing a command execution time with sudo, `time` should be before `sudo` or after `sudo`?

when timing a command execution time with sudo, time should be before sudo or after sudo? time sudo command or sudo time command which one is correct? the output seems very different to me ...