Questions tagged [sudo]

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

sudo allows users to run commands as another user. It is typically used to allow trusted users to run commands as root, without giving them root access, or to allow a user to run commands as another user. Both of these uses must be allowed by the root user.

886 questions
11
votes
1 answer

su: /bin/bash: Resource temporarily unavailable

Unable to switch user to postgres. Ulimit settings for postgres user is set with reasonable limits. We are not hitting max. No errors in /var/log/messages. Error: BETA -bash-4.2# sudo su - postgres su: /bin/bash: Resource temporarily…
Chucks
  • 521
  • 1
  • 7
  • 13
11
votes
1 answer

How do I set both NOPASSWD and SETENV on the same line in sudoers?

In the sudoers file, how can I use multiple Tag_Specs on the same line. Normally if I don't want to ask for a password I will do something like this: who where = (aswhom) NOPASSWD: commands I want to use the SETENV tag so that users can preserve…
David
  • 376
  • 1
  • 3
  • 9
11
votes
2 answers

No TTY present when running commands over SSH in here-document

I'm trying to run a command over SSH like this in a here-document: ssh example.com <
lpfavreau
  • 439
  • 2
  • 8
  • 19
11
votes
7 answers

Where is the sudoers file on Solaris?

Where is the sudoers file in Solaris? Is it different between Solaris versions (specifically, 9 and 10)?
Jon Kruger
  • 241
  • 2
  • 4
  • 9
10
votes
3 answers

Securely use find with sudo

On a Linux server, I need to remove root privileges from a group of users. But those users have legitimate reasons to be able to use the "find" utility to search for files based on file names, modification dates, and other metadata. On the server,…
Troels Arvin
  • 652
  • 7
  • 17
10
votes
2 answers

Setting password on sudo su for Amazon EC2 Instance

Our staging server is on an Amazon EC2 instnace. When you ssh into it you can execute a sudo command or sudo su without having to enter a password. Is there anyway I can require a password from a user when they try a command with sudo? I have a…
Holly
  • 1,027
  • 5
  • 14
  • 25
10
votes
9 answers

Disable su on machine

Is there a way to allow su only for specified users (like using visudo for sudo). The reason for this is I'd like to keep a simple (weak) password for my root account and have accounts that can su/sudo only be able to login to the machine using a…
verhogen
  • 333
  • 2
  • 4
  • 14
10
votes
2 answers

Ansible Fails to Authenticate Sudo Even When Sudo Pass is Given

Problem Using the latest, stable Ansible build, I have an odd problem where my playbook hangs on one server during "Gathering_Facts" but works fine on other similar servers when using Sudo. On the Ansible server, I run as my user (NIS user) and use…
BrM13
  • 163
  • 1
  • 1
  • 10
10
votes
2 answers

Symbolic link and sudo

I create a symbolic link: ln -s /tmp/folder1 /tmp/folder2 Then I go to /tmp/folder2 and run pwd: $ cd /tmp/folder2/ $ pwd /tmp/folder2 $ sudo pwd /tmp/folder1 # <-- This is the odd part Why does pwd with sudo give the original directory? I'm…
iDev247
  • 751
  • 1
  • 12
  • 23
10
votes
5 answers

Limiting the use of `sudo -s`

I am setting up Nagios on some of my Linux servers and have run into a bit of an issue. The check_ide_smart plugin requires root access to the system to run. To run it, I use the check_by_ssh plugin to ssh into the nagios account on the remote…
Chris Lieb
  • 315
  • 5
  • 10
10
votes
2 answers

Where does sudoer reports go?

So I'm testing out a small CentOS build (rackspace cloud). I set up my user and went to do some sudo'ing. Well, I forgot the step to add my user to the sudoers file with visudo. So of course, I get this error: is not in the sudoers file. This…
Derek Downey
  • 3,955
  • 4
  • 27
  • 29
10
votes
1 answer

Repair a broken sudoers file

Possible Duplicate: Ubuntu : borked my sudoers file, how can I fix it? Problem description: I have broken my /etc/sudoers file by making a typo in it. Now I can no longer use any sudo commands as the below error is thrown. Therefore I can't fix…
Max
  • 3,523
  • 16
  • 53
  • 71
10
votes
2 answers

Is it possible to use sudo with !requiretty for a specific command

I am trying to allow a specific command to be run under sudo without a tty. I found that I can disable requiretty for a group : Defaults:%support !requiretty But I dont know how to do it for a single command. Is it possible at all ?
Guillaume
  • 1,063
  • 5
  • 12
  • 24
9
votes
2 answers

should use sudo or just su root in server management?

Which approach is better? For desktop usage, it seems that sudo is better since: I can have a more consistent history as a normal user Don't need to remember two passwords, which is especially true when I don't do administrative stuff…
weakish
  • 211
  • 2
  • 7
9
votes
3 answers

User name before sudo

I got a script requiring sudo, but the script must set parameters according to the original user, such as: chown "${USER}:${USER}" dir If I set it under sudo, I just end up with chmod root:root, which doesn't help. So how can I get the user name…
Bite code
  • 409
  • 5
  • 17