The sudo command is a program for some Unix and Unix-Like operating systems, that allows a user to execute programs with the security privileges of another user. Typically those of a superuser or the root user.

learn more… | top users | synonyms

0
votes
1answer
41 views

Why does 'which' give incorrect result?

I am executing on a Ubuntu 12.04 shell the following command: sudo bash -c "echo $PATH; which python" which displays something like ...
0
votes
1answer
581 views

Added user as sudoer but still prompted for password after ssh key-based login authentication

This unanswered question is similar to mine except my situation is simpler. After successfully logging in as user ubtuntu with ssh, any sudo command prompts for the user's password with: [sudo] ...
0
votes
1answer
120 views

why can't a user without root privlidges still sudo -u as himself?

I was writing a simple script that had to be run as 'user'. I run it half the time as myself and half the time when su as the user, so to save time I wrote it as sudo -u user ./doStuff but this ...
0
votes
3answers
1k views

Change owner of the root folder and subfolders (Ubuntu 13.04)

I accidentally set owner of root folder (/) and all subfolders to one user by command $ sudo chown -R 'userName' /* Now I wanna set owner back to root user by command $ chown -R root:root /* But ...
1
vote
0answers
181 views

Moved /lib64 to /backup_lib64 using sudo, now sudo doesn't work on CentOS6.4

I did sudo mv /lib64 /backup_lib64 to test some compilation. Now sudo doesn't work at all farhat@heracles:~/software/sudo-1.8.7$ sudo ls sudo: unable to dlopen /usr/libexec/sudoers.so: (null) ...
0
votes
2answers
1k views

Why can I only run 'sudo node' and not just 'node'?

I just got a new macbook and installed node.js using the official installer. For some reason I can only run node.js using sudo node and not just node. I double checked the $PATH and the path to node ...
4
votes
1answer
347 views

sudo -k vs. sudo -K

I know what the man page has to say about the -K and -k : ‑K The ‑K (sure kill) option is like ‑k except that it removes the user's cached credentials entirely and may not be used in ...
0
votes
1answer
726 views

How can I list all users who can su into a generic account

I have a generic account several users can su into, I however would like to find the name of all users who can do this. Thanks, Oscar
0
votes
2answers
60 views

OS 10 - How to keep my account superuser?

I'm not using root on my macbook, so almost every time I will get some permission error which reminds me of adding 'sudo'. But it's so awkward. Is there any way to get around this issue? Can I make my ...
0
votes
1answer
162 views

Sudo password not required? OS X 10.8 (Mountain Lion)

I recently upgraded to a Macbook Pro Retina running OS X 10.8.3. I was going through the process of installing various command line tools when I noticed that it wasn't asking for my root password when ...
1
vote
1answer
3k views

Why there is no sudoers file: “/etc/sudoers: No such file or directory”?

I am trying to add a new admin user, but: # adduser username admin adduser: The user `username' does not exist. # man sudoers No manual entry for sudoers # less /etc/sudoers /etc/sudoers: No ...
0
votes
0answers
77 views

How to edit a remote file with implicit su-ing to another user on remote host

I want to edit files on Unix/Linux servers from my PC (running Linux and/or Windows). However due to security, I cannot log into the remote server as the file owner, but as my named user, then sudo su ...
0
votes
1answer
408 views

bash can't find sudo command on friendlyarm

I'm trying to work with this friendlyarm 9 board I got recently but it can't find some basic bash commands and I couldn't find a solution for it anywhere. When I type any command with sudo or even ...
1
vote
1answer
95 views

Download interrupted on Terminal - cannot reinstall

I was downloading the icedtea-7-plugin package for Ubuntu on the Terminal. I used the sudo apt-get install icedtea-7-plugin just like any other person would and I turned back to what I was doing, for ...
5
votes
2answers
180 views

How do I prevent all console access except via key-authenticated SSH?

I have a server environment for which the only methods of login would be SSH or local terminal in the datacenter. I have set this up to allow a specific user to login only with a key, not password ...
0
votes
2answers
102 views

Why sudo python and python in terminal start two different versions python?

I had python 2.6 in my server to begin with. Then I downloaded python 2.7 and installed using make and make altinstall. When I try just python in the terminal it opens up python 2.7 but sudo python ...
1
vote
1answer
143 views

Avoiding accidental 'rm' disasters

Today, using sudo -s, I wanted to rm -R ./lib/, but I actually rm -R /lib/. I had to reinstall my OS (Mint 15) and re-download and re-configure all my packages. Not fun. How can I avoid similar ...
0
votes
2answers
73 views

Sudo and perform scp

Possible duplicate of scp to remote server with sudo I'm facing the following issue: A folder (with sub-folders) with files belonging to usr1:usr1 I login with another user usr2 usr2 can do sudo -u ...
0
votes
1answer
2k views

How to enable sudo commands over SSH without asking password?

I have server A and server B (both Ubuntu 10.04 LTS) doing different tasks. Server A needs to poke Server B, which generates a file and scp's it back to server A when done. This is all in-house and I ...
2
votes
4answers
2k views

Is it possible to run software as a different user under OS X Mountain Lion?

I've been trying to run apps as a different user. Attempt 1 sudo -u otheruser open /Applications/TextEdit.app launches the app but it uses the current user, not otheruser. Attempt 2 login username ...
0
votes
1answer
77 views

Why sudo su don't pass as root, but password is ok?

In Ubuntu I have one normal user root1. And till now when I want to be a root I do: root1@host:/home/root1$ sudo su [ sudo ] password for roo1: type password and I had: root@host:/root:# but now ...
0
votes
1answer
233 views

How can I automatically save a list of open files in Geany, with cron or otherwise?

I use the Geany IDE for programming, and it does not reliably reload my previously open files, for example after a power outage. I found that Geany has a command line feature which returns a list of ...
0
votes
0answers
101 views

autologin to root user with .cshrc

How do we cause login cshell to automatically execute sudo su - when a user first ssh into the linux box from Windows putty ? We tried putting this line sudo su - in .cshrc file but it is never ...
2
votes
1answer
121 views

one sudo for multiple terminals

Sudo root permissions are given for specific time, but only for one terminal. If I want to use sudo in another terminal in that time period, I have to type password again. How to force sudo to works ...
0
votes
1answer
946 views

Shutdown Debian from php script

I am trying to shutdown my RaspberryPi running Raspbian from a php script running on lighttpd webserver. shell_exec("sudo /sbin/shutdown -h now 2>&1"); I added lighttpd ALL=(ALL) NOPASSWD: ...
23
votes
3answers
1k views

Sudo su vs su linux

If I enter in the password to su when prompted, it doesnt work while sudo su does. Also, when a command is executed using sudo (command), does sudo automatically execute it by root by default (since ...
1
vote
2answers
752 views

Trying to enable passwordless sudo

I want to enable passwordless sudo for user "bamboo" on my host, so I have added bamboo ALL=NOPASSWD: ALL and also %admin ALL=(ALL) NOPASSWD: ALL (user bamboo is in the admin group) to the ...
1
vote
3answers
918 views

Unable to use sudo su - command

I am new in ubuntu, i am trying to run following command sudo su - Bu i am getting following message sudo: unable to open /etc/sudoers: Permission denied sudo: no valid sudoers sources found, ...
4
votes
1answer
711 views

Why does redirection fail when passing through ssh, sudo and sh?

After reading this question, I know that I have to do sudo sh -c 'ls -hal /root/ > /root/test.out' to avoid the "Permission denied" error. But when I do ssh hostname sudo sh -c 'ls -hal /root/ ...
0
votes
1answer
436 views

how to run a program with root privilege in a remote linux host

I want to run a program on many remote hosts these program may run serveral hours and it needs root privilege I have uploaded the program to those remote hosts I can only ssh into those machines ...
0
votes
3answers
93 views

What types of users can I use with “sudo”?

I thought you could only use sudo to temporarily become root: sudo vim /etc/resolv.conf But recently I saw a shell snippet depicting a user using sudo to become a specific user: sudo -H -u devops ...
1
vote
1answer
575 views

how to correct sudo permission

I'm running AWS EC2 Micro instance and had issues getting permission to the root access with EC2-user. Followed a tutorial online and ran the following commands: sudo chgrp ec2-user /etc sudo chmod ...
0
votes
2answers
310 views

run command with root privileges as nonroot user

I want to set up steam to run automatically with a higher than default priority, which involves starting it with nice. But to set a priority lower than 0, I must be root. Problem is that steam doesn't ...
0
votes
1answer
240 views

How to config sudoers file?

I'm using ubuntu server 12.04 LTS I want to know how to configure my sudoers file (obviously, using visudo), to permit an user to run commands like root (doing something like "sudo service x ...
1
vote
2answers
181 views

wget: different speed in sudo and user mode

If I execute wget from my terminal to download something, it realices multiple attempts to download it, and eventually it downloads it (or not!). For example, with three attempts and 10 seconds of ...
2
votes
3answers
346 views

Mail me when someone runs sudo

I have added the below lines to /etc/sudoers.d/my_sudoers Defaults mail_always Defaults mailto="email@domain.com" I get an email every time sudo is run How can i modify this so I only ...
0
votes
1answer
107 views

Enable a user to have superuser privelages locally but with password input

Is there a way to have user privelages that would normally require superuser privelages, WITHOUT USING THE TERMINAL? I'm thinking like a dialogue that pops up when your trying to access a folder/file ...
2
votes
1answer
3k views

Add a user to sudoers file, for just one service

I want to add a user to the sudoers file so that it can only start, stop and restart a particular service. I am using Debian and can access the sudoers file using sudo visudo, I am stumped now though ...
0
votes
1answer
430 views

Prevent SUDO from executing passwd

I want to prevent users with sudoer access from using sudo to execute passwd (and thus changing the root password). Is this possible? If so, how can it be accomplished?
0
votes
1answer
86 views

Gentoo : cannot modify the hostname file as a sudoer

I am trying to change the hostname of a Gentoo host using a sudoer account. I use the following procedure : sudo rm -f /etc/conf.d/hostname sudo touch /etc/conf.d/hostname sudo echo "hostname=foo" ...
2
votes
2answers
3k views

Changed the permissions on /usr/bin

I executed sudo chown -R USER /usr/bin Now, when I try to "sudo" anything, I get sudo: effective uid is not 0, is sudo installed setuid root? I tried pkexec chown root:root /usr/bin/sudo and ...
1
vote
2answers
5k views

sudo to run command as different user

I am trying to setup a script that will be run as a "maint" user. The script is basically a menu that allows maintenance personnel to do different things on the server. However, some of the scripts ...
0
votes
3answers
141 views

Is Windows vulnerable because its sudo equivalent does not require a password? [closed]

On Windows from Vista and onwards, you have to press through an UAC dialog to perform something that requires admin rights like installing or uninstalling programs. On Linux to become root, you have ...
2
votes
0answers
158 views

Forklift sftp with sudo command?

Is it possible to somehow issue a sudo command while using Forklift to transfer files?
0
votes
1answer
64 views

All the command line command become “Not found” after installing Mountain lion

I just found after installing new Mountain lion, I can no longer use the command line because all the command seems to be " NOT Found", even for basic "sudo" command sudo: command not found How can ...
3
votes
1answer
887 views

How to add CLASSPATH parameters permanently when using sudo?

On Ubuntu 12.04.2 LTS 64bits, when using sudo or sudo -i or sudo su or even su in a session, in order to use both Java AND Scala I need to enter the following commands: sudo -i ...
1
vote
2answers
498 views

Function defined in my user's .bashrc causes an error when I sudo su

I have a function defined in my user's .bashrc file that displays my current git branch name at my command prompt: parse_git_branch() { git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* ...
1
vote
1answer
303 views

launching php script as root from command line

How can I execute php script as root user? I tried: sudo ./script.php and in my script I've got at 1 line: #!/usr/bin/php
5
votes
1answer
420 views

Two password (factor) authentication to root user / sudo

With regards to running Linux remotely (SSH) I'd like to employ two levels of authentication for accessing the system with root privileges. I have the root account disabled / locked out so direct ...
0
votes
2answers
171 views

i want alice to run any command as root, but can not run commands as any other user

Say I have 2 users - 'alice' and 'bob' and want to allow 'alice' to run any command as root, but not run commands as 'bob' or any other user, am I able to do this, and if so how ? consider this ...