sudo - Execute a command with superuser privileges.

learn more… | top users | synonyms

0
votes
1answer
30 views

Restore sudo privileges

Trying to install tor-browser, I screwed up my sudo privileges when I tried to take ownership of a directory. Now I get a message: sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit ...
1
vote
1answer
32 views

su or sudo keeping/removing certain environment variables

I would like to be able to log in as another user and keep most, but not all of my environment. Specifically, I would like to set $HOME to the correct value for the new user, but keep probably ...
0
votes
2answers
52 views

Why does sudo ask for a password?

USER@notebook:~/foo/notebook$ sudo /usr/bin/mplayer /home/USER/foo/notebook/something.mp3 [sudo] password for USER: USER@notebook:~/foo/notebook$ USER ALL=(ALL) NOPASSWD: /usr/bin/mplayer ...
1
vote
3answers
69 views

How can I make sudo forget the password automatically after one command?

My problem is the following: I want to edit a file that is only readable by root. That's why I use sudo vim ~/thefile I could type sudo -K after exiting vim, but I was hoping that there's an ...
0
votes
2answers
20 views

Is there a sudoedit equivalent for vimdiff?

I'm trying to get into the habit of editing root-owned files with sudoedit, instead of sudo vim. This has a few advantages, one of which is that it uses my user's ~/.vimrc. Is there an equivalent, ...
1
vote
1answer
24 views

Different password for login and sudo - security concerns

I'm planning to follow the steps described in this answer to have a different password to log in and sudo. The reason is that I want a high security password to access my account or unblock the ...
0
votes
1answer
18 views

Is it possible to capture SSH+sudo output locally without writing the hostname and [sudo] lines?

Is it possible, when locally writing output from SSH command execution, to suppress the hostname and [sudo] lines? For instance, when I SSH into a server and run sudo <command> it displays ...
0
votes
1answer
45 views

C/C++: Running multiple commands as root

I want to execute commands within my C program. However, I need root priviliges to create some folders. I run the following: system("echo <rootpass> | sudo cd <folder> && make ...
2
votes
3answers
32 views

How to launch xev from console?

I am trying to launch Xev from console, it always gives "unable to open display", I need to launch xev from a console as another user (I use sudo -u '#1000' to do this). I know xev has a "display" ...
1
vote
1answer
30 views

How do I install some required libraries for a program without sudo?

I am trying to run a program on a computer running Red Hat 6.5. This results in the three following errors: "/lib64/libc.so.6: version `GLIBC_2.14' not found" "/usr/lib64/libstdc++.so.6: version ...
0
votes
2answers
23 views

Ubuntu CentOS RHEL cross bash script su support

I know that title was a little ambiguous. Allow me to explain our issue. We designed an installer script on Ubuntu since Debian based systems are our primary core, however, some of our cloud based ...
-1
votes
1answer
23 views

sudo issue during echo something to a root file [duplicate]

I have a problem, during write something into a root file: $ ll /sys/bus/usb/devices/3-2/power/wakeup -rw-r--r-- 1 root root 4096 Feb 16 17:28 /sys/bus/usb/devices/3-2/power/wakeup $ sudo echo ...
0
votes
0answers
11 views

Will I be able to install a service as a sudoer?

I will need to install a custom application as a service on a RHEL 6.2 box this weekend. Will I be able to do this with sudoer powers or will I need the root password for anything?
0
votes
0answers
40 views

apache user cannot sudo while running via httpd

I have a requirement where an web application (php) must run a script on another server. I tested running the remote script as apache user by sudo-ing to the apache user via the root user. The script ...
1
vote
1answer
42 views

File that is only readable with root privileges

I have a binary file that needs to run at startup on all accounts (including unprivileged user accounts), so a command to run it will be put into /etc/rc.local. The program itself will have only ...
-1
votes
0answers
16 views

Why, after I've used visudo, do I need to completely logout and back in for the changes to take effect?

I can see this has been asked before, with the answer being that processes inherit the user/group of the parent. This explanation doesn't make sense for the situation where I've done something like ...
3
votes
1answer
38 views

Puzzle over sudo and paths

I have a couple of programmes which are in /usr/local/bin which require root privileges to run. If I run sudo my_prog I get sudo: my_prog: command not found I have to write sudo ...
1
vote
1answer
30 views

Hotkey for doing sudo suggestions

On Ubuntu and Debian, often if I try to run a program I will get a message that says something to the effect of: You don't have that program. To get it type sudo -apt -get -install programName ...
0
votes
1answer
39 views

finding and replacing text [duplicate]

Does any one know how to find and replace text in a file. it can be implimented into a bash file. i would like to find the line and the output the text to it the file can only be opened with the root ...
0
votes
1answer
55 views

ERROR: no tty present and no askpass program specified ; TTY=unknown ; PWD=/ ; USER=root ; [duplicate]

In my /etc/sudoers.d/myAppCommand file I set some command like this. Cmnd_Alias APP_CMD = /opt/myApp/lib/app-start, \ /opt/myApp/lib/app-stop, \ ...
24
votes
6answers
2k views

Why is it risky to give sudo vim access to ordinary users?

I'd like to create a new user and give him sudo access. To be specific, I want him to use sudo vim and edit httpd.conf. I wrote this in sudoers: user ALL=(ALL) /usr/bin/vim ...
3
votes
1answer
86 views

Can I run a command loaded from .bashrc with sudo?

I have some custom functions and aliases defined in my .bashrc file. Sometimes I need to execute whem as root. I then do something like: $ sudo custom_cmd 80 ...
0
votes
1answer
31 views

How to add “sudo” group

I've done a mistake: I've removed the 'sudo' group, because I have forgotten the -a option (I wanted to add 'video' group): sudo usermod -G video $USER Now, when I want to call sudo I have this ...
0
votes
1answer
49 views

“Sudo” prefixed command doesn't work; without sudo does.

I suspect this has been answered before, but I don't know what this is called, so I can't really search for it. How come this works : $ grep H=p <(udevadm info /dev/ttyUSB0) E: ...
2
votes
2answers
82 views

What is the meaning of sudo sudo?

I am using Cloud9 for Rails development and it uses an Ubuntu environment. In the documentation about using the PostgreSQL database, it says: Connect to the service: $ sudo sudo -u postgres psql ...
-2
votes
3answers
1k views

Username is not in the sudoers file. This incident will be reported

I am running Ubuntu 12.04 on my laptop using VMware Player. I am not sure why but I have an account called "User Account" in addition to my account that I usually login to use Ubuntu. Well that was ...
1
vote
2answers
38 views

sudo command is unsucessful when invoked from file manager

I'm trying to run the following script on an install of Fedora 20. #!/bin/bash password={password} echo "$password" | sudo -Sk /bin/bash -c '[[ $EUID -eq 0 ]]' [[ $? -ne 0 ]] && zenity ...
4
votes
2answers
823 views

Is 'echo “Defaults insults” >> /etc/sudoers' safe?

Is this safe? echo "Defaults insults" >> /etc/sudoers If yes, can I do this? echo "## First line" >> /etc/sudoers echo "### Second line" >> /etc/sudoers echo "Defaults ...
9
votes
3answers
512 views

Why does the root user need sudo permission?

[root@notebook ~]# grep root /etc/sudoers root ALL=(ALL) ALL Question: Why does the root user need sudo permissions? I've seen it on different UNIX OSes. Can someone please explain this?
1
vote
2answers
56 views

Locked out of my own mac terminal?

So recently, some of my friends had been tampering with my files and data through terminal, so I decided to secure it by doing two things: First, I added the following to my ~/.bash_profile for ALL ...
0
votes
1answer
31 views

Sudoers - group managing and reboot/shutdown

I've got a group (let's say name "group1", ID = 1234) and a user (let's say name "user1", ID="4321"). I want to do two things: I want that user to change passwords from other members of that group, ...
0
votes
1answer
30 views

How does sudo -E work here?

I executed the following command to add a ppa repository in Ubuntu: sudo add-apt-repository ppa:ppaname/ppa This command returned an error that the ppa name format is not correct. Then I looked here ...
2
votes
1answer
43 views

Use current user environment variable in sudoers file

I want some of my users to be able to change their password with sudo command because at the time they log in, they are passwordless (ssh keys connection). My users have no password (and this is ...
1
vote
1answer
45 views

Difference between sudo make and sudo -s ; make

What are the differences between sudo make and sudo -s make First example do not work with my software, there is always a header file missing. Login as root with sudo -s and compile works fine. ...
0
votes
1answer
47 views

how to use command args in sudoers file Cmnd_Alias?

How do I specify command arguments in sudoers? As a background, aws command is actually a gateway to a whole bunch of sub-systems and I want to restrict the user to only run aws s3 cp ...any other ...
0
votes
1answer
50 views

Sudo User: Not able to see the home directory of other users

I created sudo user hrsupport with following commands: hrsupport ALL=ALL, NOPASSWD: /bin/chown, /bin/chmod, /bin/chgrp, /scripts/pkgacct, /scripts/restorepkg How can I achieve this The hrsupport ...
6
votes
2answers
69 views

Linux graphical password dialog trick security

When we run a command by sudo, the password is asked [sudo] password for user If the sudo is not typed the password should not be asked. If asked, I would assume it as a fraud by the application. ...
-1
votes
2answers
79 views

Is it possible to write a script that run su or sudo command without typing password? [duplicate]

Is it possible to write a script that run su or sudo command without typing password?. I googled and its said that su doesn't read password from buffer. So is there any solution?
2
votes
2answers
224 views

sudo as another user with their environment

$ whoami admin $ sudo -S -u otheruser whoami otheruser $ sudo -S -u otheruser /bin/bash -l -c 'echo $HOME' /home/admin Why isn't $HOME being set to /home/otheruser even though bash is invoked as ...
2
votes
2answers
57 views

How can I configure Linux to not require sudo for specific commands for specific users?

I am sure this question has been asked before but I can't find an answer. I would like to configure Linux so that when I enter specific commands (e.g. apt-get), I wouldn't have to enter password as I ...
2
votes
1answer
130 views

permision denied error ubuntu update with sudo

Running the below command throws the Permission denied error in Ubuntu Server 14.04.1 LTS sudo apt-get update && apt-get dist-upgrade and the error is Get:16 ...
2
votes
1answer
94 views

Is there a difference between “gain root privileges” and “execute any command”?

I recently opened my sudoers file and noticed the following: # Members of the admin group may gain root privileges %admin ALL=(ALL) ALL # Allow members of group sudo to execute any command %sudo ...
0
votes
2answers
300 views

Can't install or download anything in pear os 8

I recently installed Pear OS 8 and have ran into many problems since. Essentially, I can't download or install anything. At first I was getting a "failed to download repository information" error. I ...
3
votes
2answers
145 views

forward function and variables into sudo su - <user> <<EOF

I have declared functions and variables in bash/ksh and I need to forward them into sudo su - {user} << EOF: #!/bin/bash log_f() { echo "LOG line: $@" } extVAR="yourName" sudo su - ...
1
vote
1answer
70 views

Call sudo from a script called by xbindkeys

I have a macbook pro and I am in the process of binding scripts to control the backlight level on my keyboard. I wrote 2 scripts and they work perfectly I just cant get them to run on a keypress. I ...
2
votes
1answer
57 views

sudo - ubuntu 12.04 [closed]

I am running a Ubuntu 12.04 LTS server. Today I have been doing some maintenance to the server, and a security audit. I realized that sudo is not working the way I expected it to. In the default ...
0
votes
1answer
17 views

sudo rule with placeholder

i want to allow the use of /usr/sbin/ufw for a special user. But only for a given command: in my /etc/sudoers file i have now (for blocking IPv4 addresses): blockuser ALL=NOPASSWD: /usr/sbin/ufw ...
3
votes
2answers
37 views

Is there a way to run sudo without running another unneccessary command?

I wanted to run two sudo commands, piping the output from one to the other. However, when I haven't entered my password for sudo recently, it prompts me for the password. The pipes and two sudos seem ...
1
vote
1answer
38 views

Use sudo from another programm

I was wondering it is safe or an acceptable practice to use sudo to run an application from another one. For example, Let's say I have an application that uses a configuration file to do its work and, ...
3
votes
1answer
170 views

Why is $HOME inherited when I start a shell with sudo?

I'm setting up a Vagrant box and I noticed something I found odd. root@box:~# sudo --user=vagrant bash bash: /root/.bashrc: Permission denied vagrant@box:~$ export declare -x HOME="/root" Why is ...