sudo is a tool which allows users to run commands as another user (usually the root user)

learn more… | top users | synonyms

0
votes
1answer
31 views

Ansible, Vagrant, sudo and ssh-agent

So I've seen this question and added the Defaults env_keep+=SSH_AUTH_SOCK into my /etc/sudoers file but I am still unable to clone from github on my Vagrant box using sudo: true and sudo_user: ...
0
votes
0answers
22 views

Sudoers, allow user to use root alias

Actually, my root have to aliases: alias unpool='/path/to/my/scripts/unpool.sh' alias pool='/path/to/my/scripts/pool.sh' I have the same for my user in ~/.bashrc I defined my /etc/sudoers.d/user ...
3
votes
3answers
255 views

How to SSH after remotely restarting Redhat and enter recovery mode

I need to enter recovery mode of my redhat box which is running remotely on a virtual machine. OS: RedHat 5 64-bit Enterprise Edition I am logged into the box using SSH. I can restart using the ...
1
vote
2answers
1k views

Defining hosts in sudoers file

I want to edit my sudoers file so users have different privileges based on where they are logging in from. I want to have 3 different locations: External network(internet), internal(local lan) and the ...
0
votes
2answers
126 views

Saved Kitty Password Extraction

I am having a ubuntu server and forgot the root password. I could not find the pass in any documentation (My fault). Now I have another user which is in the sudo list but the password of that user is ...
2
votes
3answers
45 views

Grep access on maillog for non root

I would like to grant a specific (regular) user grep access on my maillogs (/var/log/maillog*). I'm not prepared to change the log permissions, as they should remain root-only, so I think the ...
0
votes
2answers
41 views

Limit user to access only 'docker inspect'?

Is there a way to give access for a user (www-data to be exact) to access ONLY 'docker inspect'? Any working solution is acceptable
1
vote
0answers
50 views

Sudo Access for Active Directory Groups

I have my Linux machine connected to AD but I am unable to get sudo privileges. I can sign on using AD credentials, but sudo doesn't work. I have looked at everything I can find and everyone says to ...
-1
votes
1answer
11 views

Why syntax error with visudo ¿?

What's wrong with this line of sudoers file? %test ALL=(ALL)NOPASSWD:/usr/bin/supervisorctl status test, /usr/bin/supervisorctl start test, /usr/bin/supervisorctl stop test, /usr/bin/supervisorctl ...
5
votes
4answers
4k views

Sudo asks for password twice with LDAP authentication

I have Ubuntu 8.04 LTS machine and Windows 2003 AD domain. I have succesfully set up that I can log in with domain username and password, using domain prefix, like "domain+username". Upon login to ...
0
votes
1answer
26 views

sudo (-E) doesn't preserve path, even when configured appropriately

I have circus installed in a python virtualenv using virtualenvwrapper, and I want to run it with sudo. Sounds simple, right? Unfortunately even after reading man sudo and man sudoers, I don't ...
0
votes
1answer
48 views

Pulling Read restricted files from a remote system with rsync and sudo

A remote system generates statistics files every 5 minutes and places them in a certain directory. At any given time there are 1000+ files in that directory. Every 5 minutes I want to copy the ...
0
votes
1answer
19 views

Allow login as any user from group by sudoers

I'd like to add to /etc/sudoers rule to allow login any user from group admin as user from group users. Example: In group admin I have: alan and smith. In group users: anna, mike. And other users: ...
0
votes
1answer
160 views

Edit a remote file in Vim with sudo when ssh root login is disabled

I am trying to determine a way to edit remote files in Vim that require sudo, but still use my local vim config and plugins. Currently I can open vim and :e scp://me@server//some/root/file and make ...
1
vote
0answers
14 views

Is it safe to create symlink under /var/www/ which points to my home directory? [duplicate]

I am using local Ubuntu server with Apache 2.4. I am running as a default user Ubuntu and each time I need to change something under /var/www/ I have to use sudo to avoid permission denied messages. ...
1
vote
1answer
2k views

winbind separator and group name behavior in getent group, constantly changing

I have a problem that occasionally apprears-dissapears and it drives me nuts. My Debian servers are authenticated against AD and only "linuxadmins" group member can SSH to server and "sudo su". SSH ...
8
votes
5answers
5k views

Ubuntu : borked my sudoers file, how can I fix it?

I was editing my /etc/sudoers file and saved it but it has a syntax error in there. Now I can't 'sudo vim /etc/sudoers' because sudo thinks the sudoers file is not valid. How can I fix this?
3
votes
2answers
249 views

Strange PATH when use sudoers via ldap

I have a working LDAP authentication environment. LDAP server is on ubuntu 12.04 machine while client are all centos 6.4 machines. Recently I configure sudoers in LDAP following this article ...
1
vote
3answers
490 views

which and sudo not using the same path

$ which reboot /usr/bin/reboot $ sudo reboot Sorry, user myusername is not allowed to execute '/sbin/reboot' as root What am I missing here?
0
votes
0answers
10 views

Privileges when doing sudo to another domain user [duplicate]

Suppose I have a corporate domain mydomain using MS Active Directory. In the domain I have the users myuser and youruser. Now, on one specific Ubuntu machine mymachine, myuser has sudo rights, and ...
-3
votes
1answer
57 views

can't switch to root or use sudo [closed]

I've just come into the following problem: For some reason I can't use su or sudo: usr@usr-MS-7816:~$ su Password: su: Authentication failure usr@usr-MS-7816:~$ sudo su [sudo] password for usr: ...
0
votes
0answers
26 views

sudo password being rejected, but system log-in work

adduser bob sudo usermod -a -G sudo bob I can log-in via terminal with the bob password but when i try any sudo command It asks for password but says it is incorrent. It is on ubuntu 12.04.
13
votes
4answers
1k views

Temporarlly increasing sudo's timeout for the duration of an install script

I'm trying to write a script, that will install a bunch of software, I'd like to not have to run everything as root, so I'd like to be able to prompt for a password and then go about the install, ...
5
votes
12answers
6k views

How can you prevent root password change on linux?

I'm setting up a server which other people will have sudo access to via ssh. They can install stuff and make changes as they see fit, however I still need to manage the server, install patches and ...
1
vote
1answer
22 views

Privileges when doing sudo to another domain user

Suppose I have a corporate domain mydomain using MS Active Directory. In the domain I have the users myuser and youruser. Now, on one specific Ubuntu machine mymachine, myuser has sudo rights, and ...
40
votes
2answers
4k views

Why do I have to edit /etc/sudoers with visudo?

I've noticed that the sudoers file and cron config files act in a special way compared to other config files on Linux. They need to be edited with a special wrapper rather than any text editor. Why is ...
7
votes
3answers
5k views

Is “sudo su -” considered a bad practice?

Background I know the difference between su -, sudo su -, and sudo <command>: su - - switches user to root, requires the root password sudo su - - switches user to root, requires only the ...
43
votes
10answers
17k views

How can I run arbitrarily complex command using sudo over ssh?

I have a system that I can only log in to under my username (myuser), but I need to run commands as other user (scriptuser). So far, I have come up with the following to run the commands I need: ssh ...
0
votes
0answers
23 views

mac osx ping6 only with sudo?

today I encountered a weird problem on Mac OSX 10.8.5 and IPv6: I tried to ping6 a host that is known to be up and running (I am connected to the host in question through ssh using the same remote ...
0
votes
1answer
16 views

how to put tabulator as parameter for sudo in sudoers file

I would like to give for specific user allowing to put tabulator as parameter to program. Full invoking looks like: sudo /sbin/vgs --units b --nosuffix --noheadings --separator 'TAB' I try to put ...
0
votes
1answer
35 views

sshfs mount using sudo'ed account

We have a linux system ferguson. On ferguson: I have user id a123. As user id a123, I am able to sudo su into userid admin. There is no direct login for the userid admin. We have to use our ...
76
votes
9answers
30k views

ssh-agent forwarding and sudo to another user

If I have a server A into which I can login with my ssh key and I have the ability to "sudo su - otheruser", I lose key forwarding, because the env variables are removed and the socket is only ...
4
votes
3answers
566 views

SSH: su root or sudo? [duplicate]

What is the better option: Using su to switch to root or enabeling sudo? Without the use of sudo an intruder would need to know the password (or key) of a user allowed to ssh and then also the root ...
0
votes
1answer
55 views

Amazon EC2 Centos instance needs sudo password after update

I've got a terrible problem on a running webserver. It's a webserver running on CentOS, one of the default Amazon EC2 AMI's (images). I've been able to ssh to the server and do my thing until now. ...
0
votes
1answer
67 views

sudo su not working correctly inside a bash script [duplicate]

I have a script to setup a machine that need to change to another user. Unfortunately, I get a "permission denied" after the su command. #!/bin/bash # script executed from /home/foo/ touch hi_foo cd ...
0
votes
1answer
20 views

BNF diagram for sudo file

How can I generate a (BNF) railroad diagram for /etc/sudoers file? I know the sudoers manpage has Extended Backus-Naur Form informations. Also, there are some tools to generate such diagrams (see ...
0
votes
1answer
281 views

Ansible shell command fails under sudo when it should succeed

I have an Ansible task based on https://github.com/al3x/sovereign/blob/master/roles/tarsnap/tasks/tarsnap.yml#L2 that keeps failing when it should succeed. I used to run the role with ...
47
votes
8answers
4k views

Is it OK to set up passwordless `sudo` on a cloud server?

I love the idea of accessing servers via keys, so that I don't have to type in my password every time I ssh into a box, I even lock my user's (not root) password (passwd -l username) so it's ...
-5
votes
2answers
48 views

Why isnt this sudoer command run as root? [closed]

I want to give PHP access to a very specific script using a configuration under /etc/sudoers.d. So I did the following: visudo -f /etc/sudoers.d/99-php And entered this sudo rule: www-data ALL = ...
0
votes
3answers
1k views

How can make rsync use sudo

I use rsync to mirror a number of folders on our failover server. However, some of our files, such as thumbnails or full-text indexes, are generated by our applications under the web user (named ...
0
votes
1answer
46 views

How to fix sudo file on EC2

I managed to save my sudoers file with a syntax error so now I can't do sudo -i any more on my EC2 instance. This effectively locks me out of root account since the only way to get root access on EC2 ...
4
votes
4answers
978 views

How to add a line to the end of a file which I can access via sudo?

I have tried: sudo "some string" >> test.txt But I am getting permission denied warning. Can anyone help?
0
votes
1answer
114 views

Can I use serverspec on a remote system without requiring root or sudo access on that system? [closed]

Main thing I am trying to do is to run the tests from an unprivileged user (a gui runs these tests) without giving away the keys to the castle if this user gets compromised. Most of the tests ...
22
votes
6answers
3k views

Can a program tell it is being run under sudo?

I have a program that should behave differently if it is being run under "sudo". Is there a way it can find out if it was run under sudo? Update: Someone asked why would I want to do this. In this ...
1
vote
1answer
78 views

Slow sudo and ssmtp (hosts file wrong?)

I'm running an Ubuntu Server 12.04.5 LTS and when I type sudo su it takes 30+ seconds to open the shell. Searching on internet, this problem seems related to the file /etc/hosts and /etc/hostname. ...
22
votes
14answers
29k views

Why does sudo command take long to execute?

I've been picking up Linux (Fedora 10, then 11) over the past few months (and enjoying it immensely-- it's like discovering computers all over again, so many things to learn). I've added my user to ...
2
votes
3answers
3k views

Using sudo in WinSCP

I need to update httpd.conf in /usr/local/apache/conf path. I have generated SSH key in cpanel, and selected it in Advanced options in SSH/Authentication section. Also I have tried two different ...
17
votes
7answers
11k views

Why do I not have syntax highlighting when I sudo vi <filename>?

I don't understand how to allow syntax highlighting in files I'm editing via vi when using sudo. When I 'sudo vi ' the terminal is only black & white of my terminal settings. In vi if I enter ...
1
vote
0answers
34 views

NFS local user mapping works, but not with sudo

I want to use an NFS share for backing up. I have created a local user on the client with a specific uid/gid combination that works for writing files to the NFS share. So far so good. However, I need ...
2
votes
5answers
12k views

ssh to multiple hosts and sudo multiple commands

I need to loop through and ssh to multiple hosts and run a series of commands on each. something like: for i in $(jot -w '%02.0f' 14 1) >do ssh user@host$i sudo -i "command1; command2; command3" ...