sudo - Execute a command with superuser privileges.

learn more… | top users | synonyms

0
votes
1answer
13 views

Install script - sudo authorisation compatibility?

I am currently updating a few scripts, and am planning on releasing some useful ones so others can use them (so they need to work across a wide range of machines without crashing, and without breaking ...
0
votes
2answers
21 views

Understanding Privileges in Sudoers File

I'm trying to make sense of the sudo documentation on the Debian Wiki. On it, it uses the two examples below. However I don't understand the difference between them. Why has the group sudo got ...
0
votes
2answers
37 views

Script works without sudo, fails with sudo

When I launch this script: #!/bin/bash -v sshpass -p '<pypasswd>' scp blah.img root@myip:/home/user/blah.img exit 0 with ./script.sh or nohup ./script.sh & it works. But when I do ...
0
votes
1answer
12 views

How to configure a user in sudoers such that the user can install app and can't access a specified directory

I want to add a user to sudoers, such that the user can do anything in root permission but: The user can't use mount command; The user can't access(read or write) to directory /home/protecteddir; ...
0
votes
2answers
27 views

Can't add sudo privilleges to a user

This is my first time with Debian and I don't really understand how to grant myself sudo access. I have a fresh install with a root password and a normal default user. I just want my normal default ...
1
vote
2answers
33 views

sudo / su to user in a specific group

I am looking to setup a generic user that has the ability to su/sudo to any user in a specific group. Either that or to any user that has a specific naming scheme. Is this possible on linux? I ...
0
votes
1answer
30 views

pam_unix(sudo:auth): auth could not identify password for [asteriskpbx]

to install the asterisk program, I created a sudo user and added to /etc/sudoers file like this: asteriskpbx ALL=(ALL) NOPASSWD: ALL but, when I try to start the service, I get the following ...
1
vote
1answer
127 views

Why can't I use sudo on OpenBSD?

I'm running OpenBSD 5.7 on VirtualBox on my Windows 7, to learn more about Unix, but I can't use sudo with my password. I've set up a user called adminvpn but when I try to run any command using sudo ...
0
votes
3answers
26 views

switch to sudo user with AND command doesnt work

I am trying to copy the ssh private key from one user to another user in single shot. sudo su && cp /home/sk/keys/master.pem /home/sg-user/keys/ This command works well, when i run them one ...
1
vote
1answer
47 views

Why sudo user can use sched_setscheduler SCHED_RR while root can not?

I am running Arch Linux on a Raspberry Pi 2. I have a user-space program that uses Gordon's wiringPi library and, in particular, the piHiPri() function that attempts to set the highest priority for ...
1
vote
2answers
24 views

Disallow `apt-get`, `yum` to install setuid binaries when itself run via sudo

Assume you can install something on a system because you have sudo rights to do so, but only have sudo rights for the installer. In that case it is fairly easy to create a package that installs a ...
0
votes
1answer
44 views

What are the best practices for permissions and and methods for generally avoiding using sudo? [closed]

The main point is that I only want one user to have sudo access - really only for use in set up and emergencies. I don't even trust myself with sudo access all the time. Are there best practices ...
1
vote
2answers
54 views

Prompt for sudo password rather than give access error

Can I configure Fedora 22 so anything needing root privileges asks for a password, rather than giving an error, and needing me to re-run with sudo? I wouldn't even mind having to type my password ...
0
votes
1answer
27 views

Does sudo documentedly handles characters after backslash on all UNIX-like systems? - for breaking long lines

In general, you can put a "\" at the end of your long command/line to break it to several lines. The sudoers syntax allows this too, that's OK. But: If there is an ex.: "space" after the "\" ...
-4
votes
1answer
69 views

Problem with sudoers file. Syntax error at line 82, but cannot find exactly what? [closed]

I ssh'ed into my new Linux machine (no physical access) and I have root credentials. However, I cannot run sudo commands because of some error in the sudoers file made by someone else who logged in as ...
0
votes
0answers
11 views

System problems after trying to fix touchpad

I have an acer 720p chromebook and the touchpad doesn't work after installing Uberstudent (based on xubuntu 14.04) After looking it up the internet link told me to run a script called ...
1
vote
3answers
56 views

Use alias after issuing sudo su command

I am on AIX 7.1. I have a bunch of aliases defined in my personal .profile. alias df='df -k' alias cl=clear alias h=history alias ll='ls -al' alias lt='ls -latr' alias ls='ls -Fa' alias psj='ps -ef ...
0
votes
1answer
19 views

dhcpd restart command asks for password from command line but not from a script?

I have a script that runs and will ssh into another server to restart its dhcpd. In the script, the command literally is: sudo ssh -n $SERVER /sbin/service dhcpd restart This works fine when the ...
4
votes
1answer
91 views

Is it safe for my ssh user to be given passwordless sudo for `apt-get update` and `apt-get upgrade`?

I have an SSH standard user account on my personal server, and it has sudo access (via its password). I ssh in using a public key, so I don't have to type in the account password to log in. Is it ...
0
votes
4answers
64 views

sudo for command with specific options

Is it possible to configure sudo to get root privilege to a user for running a program with some special switches? for example, how can I configure it for user admin to run netstat command as the root ...
1
vote
1answer
42 views

Why is sudo slow when I mistype my password? [duplicate]

If I'm asked for the sudo password, after typing it in correctly, the terminal moves on almost instantaneously. However, if I mistype my password, it takes a few seconds before working it out and ...
2
votes
1answer
79 views

Why sudo env is not showing all the environment variables?

I have a variable set in a script file in /etc/profile.d/somescript.sh I have modified the /etc/sudoers and added "ansible" user to the sudoers file like this: Defaults !env_reset ansible ...
6
votes
1answer
59 views

How can I make `sudo crontab -e` use my `sudoedit` environment?

I've started using sudoedit <file> instead of sudo vim <file>. One of the advantages is that it uses my local ~/.vimrc. However, when using sudo crontab -e, it uses /root/.vimrc instead. ...
1
vote
2answers
82 views

How to restore to permissions to sudoers file with no password?

The complete story: I launched an Amazon EC2 "Tier" (VPS) running RHEL 7.1 and created a key for ssh. EC2 automaticly crates a user called ec2-user for new Rhel VPSs, and it have the permissions (in ...
0
votes
1answer
55 views

PAM timestamp - how to inspecting the /var/run/sudo/<user> file?

The centos documentation stated that: ... In the PAM timestamp scheme, the graphical administrative application prompts the user for the root password when it is launched. When the user has ...
0
votes
0answers
41 views

How to manage any command access privileges on debian linux

I am using Debian 7, and my desktop is xfce. I want to achieve managing any command on Linux. For example, executing /usr/bin/xfce4-taskmanager command would not require sudo privileges so any user ...
1
vote
0answers
35 views

Allowing sudo kill for remote user for recovery purpose. Security implications?

I'm planning to create user allowed to SSH in and with right to sudo kill in case something disables local terminal/keyboard/display etc. Would probably add ps and/or htop to the list, as well. I ...
2
votes
2answers
111 views

how to pass environment variable to sudo su

I basically need to do this: DUMMY=dummy sudo su - ec2-user -c 'echo $DUMMY' This doesnt work. How can I pass the env variable $DUMMY to su? -p doesnt work with -l.
1
vote
3answers
81 views

Differences between sudo and su in inheriting environment

Why can the command run by sudo inherit the environment from the parent shell process, while the shell process after sudo su to the root user doesn't? t@ocean:/tmp$ export ME=tim t@ocean:/tmp$ sudo ...
2
votes
3answers
834 views

“ sudo: source: command not found”

$ source /etc/environment $ sudo source /etc/environment [sudo] password for t: sudo: source: command not found It seems that a different shell than bash is run to execute source ...
2
votes
1answer
65 views

how to enable sudo for one directory

I have Redhat 6.3 and I want to enable sudo command for chown,kill and chmod, so under root user I did the following: visudo #add the following line aabuhasna ALL=(ALL) NOPASSWD: /usr/bin/kill, ...
1
vote
1answer
134 views

What does “ALL ALL=(ALL) ALL” mean in sudoers?

If a server has the following in /etc/sudoers: Defaults targetpw ALL ALL=(ALL) ALL Then what does this mean? all the users can sudo to all the commands, only their password is needed?
0
votes
1answer
41 views

create a linux user with create files and write permissions without sudo access

I want to create a user in such a way that it can create a file and update the contents of the file. useradd username Now for sudo, we can create username and linking to sudo like below: useradd ...
0
votes
1answer
42 views

What are the differences between sudo and the use of groups?

I know these are tools used for improving security. But what I would like to know is what they are and how they work?
0
votes
2answers
403 views

apt-get update failed to fetch and /sources.list.d/ empty

Running the sudo apt-get update command, I got the following error: Fetched 988 kB in 16s (59,3 kB/s) W: Failed to fetch ...
6
votes
3answers
134 views

What bad things could happen if we don't use sudoedit?

We know it's safer* to use sudoedit, but what bad things can happen if we have the following in sudoers? Cmnd_Alias FOO = /bin/ed, /usr/bin/ed, /usr/bin/vi foouser LOCALHOST = NOPASSWD: NOEXEC: FOO ...
1
vote
1answer
102 views

Difference between adding sudo user with adduser or gpasswd

To add a new sudo user I believe I can call: # to create a new user sudo adduser newusername and to allow this user to use sudo I can do: sudo adduser newusername sudo or sudo gpasswd -a ...
0
votes
0answers
45 views

Applications not starting with sudo

I'm using Linux Mint 17 (Qiana) in my Oracle Virtual Box. Whenever I try to open an application with sudo, it is not working. For eg. if I try to open sublime text editor using the command sudo subl ...
2
votes
0answers
78 views

Security of sudo not asking for a password after the first time

After using sudo and entering a password to do so, sudo remembers that we have entered a password and we do not have to enter a password the next time we use it. I am concerned about the possibility ...
1
vote
3answers
84 views

Why is gksu asking me for root password and not my password?

On one of my systems, I'm running Gentoo Linux and I've installed x11-libs/gksu-2.0.2-r1. I've disabled the root account using sudo passwd -dl root and I want to be able to run GUI apps which need ...
1
vote
1answer
230 views

ssh with -Y results in “shell-init: error retrieving current directory: getcwd: cannot access parent directories…”

I ran an X app sudo'ed from my normal account, using: mylappy$ ssh -Y me@myhost.com me@myhost.com's password: [me@myhost ~]$ sudo su - [root@myhost ~]# su - me -c 'xauth list' |\ grep `echo ...
3
votes
1answer
314 views

How do I allow non-root users to control a systemd service with instances?

I need to allow users in the dba group to control the database@ services. The answer to this related question is to just list all systemctl "verbs" that I want to allow in the sudoers file, however, ...
2
votes
1answer
30 views

Run a command a as a certain user and multiple groups with sudo

I am trying to allow an normal user to run some applications under other UIDs for process separations. The applications should run with certain groups permissions (like audio or cdrom). In the ...
1
vote
1answer
34 views

Parallels on Mac - can no longer sudo within Ubuntu

I have been using Parallels on my Mac to run Ubuntu for a couple of weeks and it's been fine. Today I tried to install a package and received the following error: {user} is not in the sudoers ...
0
votes
2answers
77 views

executing command as su

I am executing this command as su. I have made the connection with SSH (using sshNet), and then when I try to set the command su -, I get no response. I have the password and the command I would like ...
5
votes
1answer
161 views

Edited sudoers file with text editor - now can't run sudo

I now know that I should never try to edit the etc/sudoers file with a regular text editor. However, minutes before I learned this, I saved a new user name in the file with Sublime Text. Now when I ...
1
vote
1answer
73 views

Running some parts of a script as an unprivileged user with shell environment

I am creating an instance configuration script that sets up a machine. I am running the script via sudo i.e. sudo run.sh. Most of the steps require root access but some of the script's steps do no ...
4
votes
1answer
290 views

Why isn't this directory being added to my PATH when I use sudo?

Ive just compiled and installed apache webserver from sources, and now I want to add the apachectl script to PATH I know I need to add the directory to the root user's PATH (as the script needs to be ...
0
votes
1answer
556 views

Some index files failed to download - Linux Mint 17.1 Cinnamon

Running sudo apt-get update i get the following error message: ... Ign http://packages.linuxmint.com rebecca/upstream Translation-en_US Ign http://packages.linuxmint.com rebecca/upstream ...
2
votes
1answer
46 views

NOEXEC and RESTRICT in sudoers

I understand the script below has a serious problem, and NOEXEC and RESTRICT are not enough as a solution to this. user ALL=(ALL) /usr/bin/vim /etc/httpd/confs/httpd.conf However, I still have some ...