sudo - Execute a command with superuser privileges.
2
votes
1answer
33 views
Allow a specific user to sudo to users that are part of group X
I have several users, which are all part of group X.
And I want to be able to give user Y to sudo to members of group X.
Obviously I don't want to edit sudoers everytime I add a user to group X, is ...
0
votes
0answers
17 views
file owner not able to renounce the ownership to root? But root can! [duplicate]
I logged in as username 'ravbholua'
I created a file bb as below:
ravbholua@ravi:~/Pictures$ echo>bb
ravbholua@ravi:~/Pictures$ ll
total 12
drwxr-xr-x 2 ravbholua sudo 4096 Oct 13 11:18 ./
...
0
votes
1answer
49 views
Can't sudo after lock password, can I recover from that?
After setup ubuntu with default settings, It allows user to login with password, so I use passwd -l [username] to forbid password login both in ssh and console.
But when I use sudo to execute ...
4
votes
5answers
107 views
Set sudo password differently from login one
As a privileged user I am trying to set the sudo password to another then the one used at login.
I have done some research but have not found an answer. Does sudo support that kind of configuration?
...
1
vote
2answers
50 views
difference between windows local admin and unix root
I am trying to understand what is a conceptual difference between unix root account and windows local admin. I am a developer and despite IT department efforts were always given local admin rights so ...
2
votes
2answers
40 views
Unable to run 'sudo chmod +w /etc/hosts'
I am logged into my remote VM (running out of ESXi) as user xyz. I wanted to change my /etc/hosts to add some network names that were not visible by default.
I first tried to run
sudo vi /etc/hosts
...
1
vote
3answers
70 views
Error : /etc/sudoers not working - Ownership wrong
I have Ubuntu 12.10 on my client system. I have an error /etc/sudoers is owned by uid 1000 should be 0. I tried booting from an Ubuntu live CD and tried:
sudo chown root:root /etc/sudoers
sudo ...
3
votes
2answers
192 views
Who is file owner if the file is created using sudo command?
I logged in using my username ravbholua:
ravbholua@ravbholua-Aspire-5315:~$ echo $LOGNAME
ravbholua
I create file named a1:
ravbholua@ravbholua-Aspire-5315:~$ echo>a1
...
2
votes
1answer
46 views
Broken sudo on amazon web services ec2 linux centOS
So I had no idea of the dangers of messing with the /etc/sudoers file, and was just trying to make a simple change in there. However, I seem to have put something with incorrect syntax in there, ...
3
votes
1answer
51 views
Keeping sudo authentication with gnome-terminal (zsh)
Can sudo sessions be shared across tabs of gnome-terminal, so that once I use sudo in one tab, I won't have to re-enter my password every time I open another tab and use sudo?
1
vote
1answer
30 views
How can I keep *all* environment vars for a specific command in sudo?
I have a script that sets several environment variables and then finally calls another script using sudo.
The script run with sudo must be able to pick up those variables, and I'm not always going to ...
1
vote
3answers
40 views
sudo as another user
I want to run a command on a shell on behalf of another user. The command is as follows:
sudo -u USER cd /home/USER
I get
sudo: cd: command not found
What is the correct syntax for the command ...
11
votes
1answer
223 views
How to tell sudo to repeat lecture once?
I'm letting one of my coding buddies have root access to my Raspberry Pi, and as I was getting everything set up, I tested sudo as him.
It gave me "the speech":
We trust you have received the ...
0
votes
3answers
69 views
How to stop regular users from Switching Users
I want to stop the normal users from using following commands
/bin/bash
/usr/bin/sudo
/bin/su
I added them in sudoers file but normal user can still use the following command This is how i add the ...
1
vote
1answer
69 views
How to make sudo accept password automatically without prompting for it? [duplicate]
I created a user named shut so that whenever one logs in using that username the machine would shut down. For that I placed the below command in the end of the .profile.
exec sudo shutdown -h now
...
7
votes
3answers
226 views
which shell will sudo use to execute a shell script without the shebang line
My environment is Ubuntu 12.04 LTS, and the sudo version is 1.8.3p1.
First I login as a normal user:
$ whoami
fin
$ cat /etc/passwd | grep -i "root\|fin"
root:x:0:0:root:/root:/bin/bash
...
2
votes
3answers
101 views
Restrict standard users to run a command with a specific argument
I know how to restrict standard users to run a command by removing execute permissions for that command. But it's possible restrict standard users to run a command with a specific option/argument?
...
7
votes
2answers
74 views
How to automatically enter sudo's grace period upon CLI login?
What I would like to do is be able to login and sudo commands immediately without entering a password again. It is very redundant to type my password twice in a row when I need to login and run a ...
0
votes
2answers
39 views
Pass flags to xargs
I want to kill a bunch of processes using this command:
sudo ps ax | grep node | awk '{print $1}' | xargs kill
But it gives me operation not permitted even with sudo.
Then I tried with kill -9 ...
3
votes
3answers
54 views
Why is PATH reset in a sudo command?
After much frustrating head-brick-wall contact, I've discovered this:
$ echo $PATH
/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/steve/bin
$ sudo bash
# echo $PATH
...
1
vote
1answer
64 views
How to pipe to bash as a different user
I am running an experiment as a way to solve a bigger problem. For the experiment, I need to install rvm as a user who does not have a shell.
To install rvm, you use the following command
\curl -L ...
2
votes
3answers
87 views
Allow a user to view the home directory of other users via sudo
I am new to system administration. We have a lab set up where we have a server and client machines. The client machines have LDAP users which has the work area for all the users in the centralized ...
4
votes
5answers
192 views
How is sudo set to not change $HOME in Ubuntu and how to disable this behavior?
On Ubuntu 12.04, when I sudo -s the $HOME variable is not changed, so if my regular user is regularuser, the situation goes like this:
$ cd
$ pwd
/home/regularuser
$ sudo -s
# cd
# pwd
...
1
vote
2answers
53 views
Can't run su after changing permissions to su file
I am running Linux Slackware 14.0. I wanted to allow to do su only to the members of wheel group, so I modified the permissions of /bin/su and /usr/bin/sudo files to this:
bash-4.2# ls -la /bin/su
...
2
votes
1answer
65 views
sudo askpass: ask from other tty
Context
I want to setup rsync backups of my server, so I run the following command
rsync -r -e ssh --rsync-path="sudo rsync" [email protected]:/ /backup/
Ideally, that command would ask my ...
4
votes
2answers
58 views
“nohup sudo …” does not prompt for passwd and does nothing
When I run
nohup sudo myscript.sh &
I only get something like
[1] 1220
in return and do not get prompted for a password. The process does not start either.
I want to run this script in the ...
11
votes
4answers
267 views
Can you give a user account multiple passwords?
I want to assign 2 passwords to a single account. What I want to know is 1) is this possible, and 2) what are the security implications of this?
The reason I want to do this is because I'm currently ...
4
votes
1answer
53 views
sudo: don't ask password when logged in with ssh key
I'd like to setup sudo in such a way that it doesn't prompt me for a password when I authenticate to sshd with a key; but do otherwise.
I don't want an answer of "it doesn't work like that" because ...
5
votes
2answers
91 views
If I type “sudo” at the beginning of a one liner, does it apply to the rest of the commands?
If I type sudo at the beginning of a one liner in bash, does it apply to the rest of the commands?
In other words, is this:
sudo foo | foo2 | foo3
equivalent to this:
sudo foo | sudo foo2 | ...
0
votes
2answers
56 views
How to kill a process that says “Operation not permitted” when attempted?
I have a process I would like to kill:
computer@ubuntu:~$ ps aux | grep socat
root 2092 0.0 0.0 5564 1528 pts/1 T 14:37 0:00 sudo socat TCP:xxx.17.29.152:54321 ...