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
890 views

Running commands as another user on their machine via ssh?

As part of my normal workflow I ssh into another user's machine, switch user to them, run a command, then exit out to my own machine again: ssh hostname sudo su user runcommand exit exit Is there a ...
1
vote
1answer
575 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, ...
0
votes
0answers
34 views

Proper way to switch users in sudoers

What is the difference between these 2 options in /etc/sudoers: user1 mymachine = (user2) ALL user1 mymachine = /bin/su - user2 For option 1, I would do the following as user1: sudo -u user2 -i ...
0
votes
0answers
45 views

Ubuntu refuses to boot up properly and sudo doesn't work

Ubuntu 13.04 64bit So this all started when I was installing laptop-mode-tool, in the middle of which Ubuntu crashed (I don't remember whether it crashed to the command line or simply crashed). Then ...
0
votes
0answers
92 views

Why fedora needs password to mount NTFS partitions but ubuntu doesn't?

Why fedora needs password to mount NTFS partitions but ubuntu does not? I guess it has a relation with write permission of /run/media/$USER and maybe fstab How can i make it like ubuntu?
3
votes
1answer
6k 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 ...
0
votes
0answers
82 views

Ubuntu Cannot Change setting all greyed our/disable

I cannot change any setting on ubuntu Firstly, I accidentally change the /usr/bin permission on 777 my sudo command stopped working I change the permission back using this Changed the permissions ...
1
vote
2answers
1k 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
2answers
1k 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
185 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
533 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
97 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 ...
2
votes
1answer
3k 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
699 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
432 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
677 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 ...
0
votes
0answers
5 views

add to sudoers from java code [duplicate]

I need to add redirection rule in iptables from my java code. I am doing it using "sudo" on Ubuntu and it works fine over there. But on RHEL, it gives error of "user not in sudoers". I know my user is ...
1
vote
1answer
101 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 ...
9
votes
1answer
9k 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
1k 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
231 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
86 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?
1
vote
2answers
1k 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
129 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
65 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
306 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
109 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
120 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 ...
5
votes
1answer
675 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
84 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
673 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
0answers
165 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
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
526 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
116 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
170 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 ...
3
votes
1answer
302 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
593 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
161 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 ...
0
votes
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
74 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
387 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
87 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
171 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
93 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
139 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
71 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 ...