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

3
votes
1answer
11k views

How to change user in winSCP?

I'm using winSCP to access Unix computers. How can I change user after I have logged into a Unix server using winSCP? E.g. I have personal account in unix computer A. I can log into this comp using ...
1
vote
2answers
2k views

What is required to sudo without a password on ubuntu?

I have got the following line in my /etc/sudoers after editing it via visudo and I am unable to sudo without a password. Does anyone have any ideas on why this is not working properly? myusername ...
2
votes
3answers
3k views

Ubuntu: Getting sudo access as guest

I installed Ubuntu Linux 12.04 a little while ago to try it out and play around with it (hence I have no idea what I'm doing). I tried changing my home directory by editing the /etc/passwd file, ...
1
vote
5answers
250 views

Pre-authorise sudo? (So it can be run later)

I often set my work computer running some time-consuming computations before I go home in the evening. After they're done, I'd like it to shutdown. However, as shutdown requires root privileges, it ...
0
votes
1answer
999 views

How to add yourself to sudoers list?

I was trying to install a package using the command: sudo apt-get install ruby-rvm But I'm prompted with nish is not in the sudoers file. This incident will be reported. I tried to add myself ...
0
votes
2answers
114 views

`sudo rm -rf /` got interrupted leaving the data partially deleted

I ran sudo rm -rf / to wipe out all data, for some reason the execution got interrupted. Now I am left with a shell that only has cd command!!! (ls, sudo, rm, etc got deleted!) What should I do to ...
3
votes
1answer
5k views

Allow users of a certain group to run a command without sudo

I know how to edit /etc/sudoers so that I can run a command as sudo without having to enter my password, however is there a way of allowing a program to be run completely without sudo, by all users of ...
0
votes
1answer
1k views

How to allow user to preserve environment with sudo?

I'm running into the following error trying to allow some environment variables to pass through to the new environment when running sudo: sudo: sorry, you are not allowed to preserve the environment ...
0
votes
1answer
562 views

sudo: source: command not found when executing tcl as sudo

I have a test.tcl (has all permissions) which contains the following- #!/usr/bin/tclsh puts "hello, world" This is how I'm executing my tcl script- sudo source /opt/test.tcl I got the ...
0
votes
2answers
2k views

what is the default path for sudo command

What is the default path of sudo command? I checked in some linux flavours and some solaris flavours, it is /usr/bin/sudo If a solaris machine is not bundled with sudo, Where it will get installed ...
1
vote
1answer
154 views

default user for sudo command

In my sudo command, if I don't mention username, will it take root as the default user? For example, In the following command- sudo mkdir /tmp/computerLinux/ using which target user will it execute ...
12
votes
1answer
13k views

sorry, you must have a tty to run sudo

I had already asked this question in Stack Overflow, but I've been asked to post it here. So doing the same. I ran this command using my java program- sudo -u <username> -S pwd I got this ...
1
vote
4answers
2k views

Alternative for sudo

I am aware that we can execute a command/script as a super/another user using sudo command. But Is there a possibility where the sudo utility itself is unavailable/removed by the user. If so, what ...
-1
votes
1answer
314 views

Preventing execution of sudo rm -rf /*

Do any Linux distros prevent the execution of sudo rm -rf /* so that people do not accidentally delete their hard drives if they did not know what they are doing?
1
vote
1answer
97 views

Let a user to run a command as a member of a group he does not belong to, using `sudoers`

How can I let a user U to run a command /usr/bin/C as a member of a group G (while he does not belong to the group G), using sudoers on Debian Wheezy?
2
votes
3answers
2k views

Change the sudo su shell

Whenever I run sudo su from my normal zsh (which uses the oh-my-zsh framework), I'm forced to use the old Bourne shell (sh) by default (obviously; this is standard behaviour on most *nix-like ...
0
votes
2answers
139 views

How can I add myself to the wheel group without using Sudo or Root commands?

Right now I am sitting at work with the task to attempt to bypass permissions and do anything I shouldn't be able to. I have nothing but a standard User and Terminal. I don't know the administrator ...
1
vote
1answer
75 views

Set timezone for sudo'ed commands

When running as a user, I like to have times printed relative to myself, so I have the TZ environment variable set. But then for example "sudo /etc/init.d/nginx restart" causes nginx to be run in my ...
0
votes
0answers
413 views

Chmod not working on /var/www/

I am running an Ubuntu 11.10 x86 VPS. I have given a user sudo privileges, and for some reason I cannot recursively chmod /var/www/. I am running Nginx with php-fpm, although that shouldn't matter. ...
0
votes
1answer
139 views

tarballing a git branch to a remote server using a sudoer

I have this compound command working for the root user and have been jumping through hoops trying to get it to work for a sudoer (rsa keys, echoing the pwd, supressing tty etc) but I can't seem to get ...
1
vote
0answers
151 views

After rebooting, why doesn't sudo prompt for password when I try to start MySQL server?

I'm having a minor problem, and I'm hoping someone can help me understand why my system behaves this way. By the way, I'm a MySQL + Terminal newbie, so please go easy on me! I've done some due ...
6
votes
1answer
1k views

Can I install Homebrew without sudo privileges?

Homebrew nicely allows package installations without sudo privileges, but it seems that I need admin privileges to install Homebrew itself. I'd like to install Homebrew in a Mac environment where I ...
1
vote
4answers
85 views

Should you install sudo even if you're the only person using the server?

Should you install and configure sudo even if you're the only person using the server and the only admin?
6
votes
2answers
781 views

Allow user to use sudo command has multiple ways, which one is better?

I am a Linux Newbie, just learning it and using Debian 7.0 Wheezy. I have seen two methods to allow user to use sudo One is to use visudo to modify /etc/sudoers and add following username ALL=(ALL) ...
0
votes
1answer
260 views

How to a sudo command which keeps all environment variables

Example command is as follows, run as a normal user which python /home/me/env/development/python because the PATH environment contains a path that points out to this instance of python (instead to ...
0
votes
1answer
43 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
682 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
129 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
2k 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
213 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
2k 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
453 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
1k 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
169 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
5k 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
85 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
524 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
119 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
198 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
136 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
160 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
78 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
3k 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
3k 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
85 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
293 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
118 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
143 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
1k 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: ...