sudo - Execute a command with superuser privileges.

learn more… | top users | synonyms

0
votes
0answers
20 views

How can I run a command as root user on Ubuntu? [duplicate]

It seems Ubuntu has disabled the root user account so su doesnt work which is causing me an issue where I have an apache log file that is owned by root $ls -al error.log -rw-r----- 1 root adm 2061050 ...
1
vote
1answer
16 views

User settings for monit? Should it run as root, or it's own user?

I'm trying to install monit on an Ubuntu 12.04 server. I have it set up, and configured (i think), but i'm not sure what user it's supposed to run as. My user on the server is called deploy, and my ...
2
votes
1answer
19 views

How can I use different kerberos principals for sudo than for system-auth?

At my organization, we're required to use different kerberos principals when authenticating for sudo than for other types of auth, such as logging in. For instance, my regular (login) principal might ...
5
votes
1answer
19 views

Running Deamon Involving GPIO on Pi

I have a deamon that monitors various things using the GPIO ports. I have used python to write the code for this using the RPi.GPIO module. I would like to ensure that the deamon is always running, ...
2
votes
3answers
170 views

`tail -n 40 /var/log/apache2/error.log` without `sudo`

Many times during the day I need to inspect my Apache log: sudo tail -n 40 /var/log/apache2/error.log I then have to provide my password. It's a clumsy workflow, so instead I am adding ...
1
vote
1answer
17 views

Does loginuid have any impact on process limits?

On CentOS/RHEL 6, when I start my daemon as root user, I see /proc/<pid>/loginuid of the process as 0 and when I start it through sudo, I see loginuid of the sudo user. Even if I do sudo su - ...
42
votes
4answers
2k views

Is there ever a good reason to run sudo su?

To launch a root shell on machines where the root account is disabled, you can run one of: sudo -i : run an interactive login shell (reads /root/.bashrc and /root/.profile) sudo -s : run a non-login ...
8
votes
1answer
87 views

Why does sudo need the loopback interface?

We were trying to install our software on an Ubuntu machine. To do so, we needed root privileges. Basically, all we needed to do was run a runnable jar like: sudo java -jar runnableJar.jar. All such ...
1
vote
0answers
47 views

Ubuntu 14.04.2 LTS: for NIS users, SSH works but console login and sudo fail

I set up a fresh Ubuntu 14.04 LTS VM on VirtualBox and did an upgrade, so now I'm sitting at 14.04.2. Our office environment is NIS+NFS. I set up autofs and NIS, and confirmed that I can log in as a ...
6
votes
4answers
289 views

Bash, execute command after invoking a new shell

I am trying to make a script like this: #!/bin/bash sudo -s something... When I execute it, I get a new shell but something is executed only when I exit the shell created by sudo -s, not inside it. ...
3
votes
1answer
55 views

Possible to pipe command using su via ssh

I'm trying to write a python script to remotely update the login passwords for a set of account I administer - I can already successfully use python to pipe remote commands via the stdin of an ssh ...
0
votes
0answers
31 views

sudo: setreuid(ROOT_UID, user_uid): Operation not permitted

I get this in my debian wheezy. I do not know what to do. I get it with every sudo command. Su password fails every time. I have seen people suggesting running service ncsd stop and then start it but ...
0
votes
1answer
21 views

Set root password AMI linux

I need set a password for root on EC2 AMI linux. I have tried with passwd root but if I enter with ec2-user and run sudo su, I get a root bash without asking for a password.
-1
votes
1answer
41 views

Error while installing wget and unzip

I am trying to install wget and unzip on unbuntu machine. But i am facing the below issue. sudo apt-get install wget unzip
11
votes
2answers
704 views

How do I make sudo remember my password for longer?

How do I make sudo remember my password for longer so that I don't have to keep typing it? I do not want to sudo su and execute commands as root all the time. I am on Arch Linux and have tried to ...
2
votes
1answer
74 views

When i run “sudo su” i get --bash: command not found for everything

I'm not good with command lines nor servers. But I needed to configure for work a AMI of EC2 AWS with LINUX So I've installed a lot of stuff, moved a lot of stuff around and then I realized that sudo ...
2
votes
1answer
43 views

Running sudo restricted commands by creating soft link

I have sudo access to one of our test machines and the following are the commands restricted for me: user_sree@sel8585:~> sudo -l user_sree's password: User user_sree may run the following ...
0
votes
1answer
32 views

When I execute a .run file as <user> it works fine. If I sudo run it, it cannot detect Java

I am trying to execute a .run file that will install some applications. I'm installing the application in /opt/... When I run it without sudo, the installer runs correctly but cannot write to /opt/. ...
1
vote
3answers
60 views

Recommended way to install software to /usr/local — use sudo or chown?

I'd like to install software from source (e.g., third-party GitHub repos) to my machine. Generally /usr/local/bin and /usr/local/src are for non-distribution-specific software, right? Taking ...
0
votes
2answers
53 views

root access on new chromeos lenovo n21 for python dev

We've purchased several new Lenovo N21 chrombooks to run Python workshops for inmates in the local jail. Trying to install Crouton, Debian, and Anaconda to prepare. All require developer mode and ...
2
votes
1answer
28 views

Is granting unattended-upgrade command to non-sudo users safe?

I have found out that I give get a non-sudo user access to certain commands with the sudo privileges. However, my plan to allow them to run apt-get dist-upgrade the system is not safe because they ...
2
votes
1answer
15 views

Allow certain guests to execute certain commands

I would like to create a new user on some of my Debian/Ubuntu hosts that is able to update the server using the commands apt-get update and apt-get dist-upgrade, but I do not wan't to give them full ...
2
votes
4answers
211 views

Sudo complains “is not in the sudoers file”

I try to install Chrome and Skype on Debian. When I'm trying to install from the terminal, or log in as administrator, even when I type the correct password, every time I receive a error. What am I ...
0
votes
1answer
73 views

How to run multiple sudo commands over already opened ssh connection

I am trying to navigate from one server"USER1" to another using ssh as a user "USER2". ssh -t $hostname "sudo su - USER2; whoami; pwd" Post executing the above, I am able to successfully navigate ...
0
votes
0answers
31 views

I can launch an app as 'myuser', and as 'root', but not using 'kdesu'. How do I launch wth 'kdesu'?

I'm running SublimeText editor on Opensuse/64. If I exec it as 'me' $ whoami dop $ sublime_text the app opens like normal, using config in /home/dop/.config/sublime-text-3/ If I change to root ...
0
votes
0answers
28 views

Use sudo in apache with SELinux

I am using CentOS 6.5. using Apache, I want to use sudo in exec. It works when SELinux stopped. how to configure SELinux to permit it. The php script <?php exec('sudo -u newuser ls /',$output); ...
2
votes
1answer
40 views

How to do sudo edit in MC?

Sometimes, when I use mc I need to edit file with sudo. Is there a way to run mcedit (internal MC editor) or any other editor with sudo directly from MC (by pressing F4)?
1
vote
1answer
33 views

Run openvpn without root privilegies

I am working with openvpn, when I type: $ sudo openvpn Every is fine, but when I type: $ openvpn bash: openvpn: command not found I try in my Debian 8 with this instructions but in Jessie I can ...
3
votes
2answers
71 views

command substitution: /dev/stdin: Permission denied

Want to read whole stdin into variable. Don't want to spawn new processes. From bash manual: The command substitution $(cat file) can be replaced by the equivalent but faster $(< file). It ...
0
votes
1answer
23 views

Install script - sudo authorisation compatibility?

I am currently updating a few scripts, and am planning on releasing some useful ones so others can use them (so they need to work across a wide range of machines without crashing, and without breaking ...
0
votes
2answers
24 views

Understanding Privileges in Sudoers File

I'm trying to make sense of the sudo documentation on the Debian Wiki. On it, it uses the two examples below. However I don't understand the difference between them. Why has the group sudo got ...
0
votes
2answers
48 views

Script works without sudo, fails with sudo

When I launch this script: #!/bin/bash -v sshpass -p '<pypasswd>' scp blah.img root@myip:/home/user/blah.img exit 0 with ./script.sh or nohup ./script.sh & it works. But when I do ...
0
votes
1answer
17 views

How to configure a user in sudoers such that the user can install app and can't access a specified directory

I want to add a user to sudoers, such that the user can do anything in root permission but: The user can't use mount command; The user can't access(read or write) to directory /home/protecteddir; ...
0
votes
2answers
44 views

Can't add sudo privilleges to a user

This is my first time with Debian and I don't really understand how to grant myself sudo access. I have a fresh install with a root password and a normal default user. I just want my normal default ...
1
vote
2answers
45 views

sudo / su to user in a specific group

I am looking to setup a generic user that has the ability to su/sudo to any user in a specific group. Either that or to any user that has a specific naming scheme. Is this possible on linux? I ...
0
votes
1answer
122 views

pam_unix(sudo:auth): auth could not identify password for [asteriskpbx]

to install the asterisk program, I created a sudo user and added to /etc/sudoers file like this: asteriskpbx ALL=(ALL) NOPASSWD: ALL but, when I try to start the service, I get the following ...
1
vote
1answer
250 views

Why can't I use sudo on OpenBSD?

I'm running OpenBSD 5.7 on VirtualBox on my Windows 7, to learn more about Unix, but I can't use sudo with my password. I've set up a user called adminvpn but when I try to run any command using sudo ...
0
votes
3answers
42 views

switch to sudo user with AND command doesnt work

I am trying to copy the ssh private key from one user to another user in single shot. sudo su && cp /home/sk/keys/master.pem /home/sg-user/keys/ This command works well, when i run them one ...
1
vote
1answer
69 views

Why sudo user can use sched_setscheduler SCHED_RR while root can not?

I am running Arch Linux on a Raspberry Pi 2. I have a user-space program that uses Gordon's wiringPi library and, in particular, the piHiPri() function that attempts to set the highest priority for ...
1
vote
2answers
31 views

Disallow `apt-get`, `yum` to install setuid binaries when itself run via sudo

Assume you can install something on a system because you have sudo rights to do so, but only have sudo rights for the installer. In that case it is fairly easy to create a package that installs a ...
0
votes
1answer
46 views

What are the best practices for permissions and and methods for generally avoiding using sudo? [closed]

The main point is that I only want one user to have sudo access - really only for use in set up and emergencies. I don't even trust myself with sudo access all the time. Are there best practices ...
1
vote
2answers
82 views

Prompt for sudo password rather than give access error

Can I configure Fedora 22 so anything needing root privileges asks for a password, rather than giving an error, and needing me to re-run with sudo? I wouldn't even mind having to type my password ...
0
votes
1answer
29 views

Does sudo documentedly handles characters after backslash on all UNIX-like systems? - for breaking long lines

In general, you can put a "\" at the end of your long command/line to break it to several lines. The sudoers syntax allows this too, that's OK. But: If there is an ex.: "space" after the "\" ...
-4
votes
1answer
106 views

Problem with sudoers file. Syntax error at line 82, but cannot find exactly what? [closed]

I ssh'ed into my new Linux machine (no physical access) and I have root credentials. However, I cannot run sudo commands because of some error in the sudoers file made by someone else who logged in as ...
0
votes
0answers
11 views

System problems after trying to fix touchpad

I have an acer 720p chromebook and the touchpad doesn't work after installing Uberstudent (based on xubuntu 14.04) After looking it up the internet link told me to run a script called ...
1
vote
3answers
74 views

Use alias after issuing sudo su command

I am on AIX 7.1. I have a bunch of aliases defined in my personal .profile. alias df='df -k' alias cl=clear alias h=history alias ll='ls -al' alias lt='ls -latr' alias ls='ls -Fa' alias psj='ps -ef ...
0
votes
1answer
23 views

dhcpd restart command asks for password from command line but not from a script?

I have a script that runs and will ssh into another server to restart its dhcpd. In the script, the command literally is: sudo ssh -n $SERVER /sbin/service dhcpd restart This works fine when the ...
5
votes
1answer
112 views

Is it safe for my ssh user to be given passwordless sudo for `apt-get update` and `apt-get upgrade`?

I have an SSH standard user account on my personal server, and it has sudo access (via its password). I ssh in using a public key, so I don't have to type in the account password to log in. Is it ...
0
votes
4answers
73 views

sudo for command with specific options

Is it possible to configure sudo to get root privilege to a user for running a program with some special switches? for example, how can I configure it for user admin to run netstat command as the root ...
1
vote
1answer
44 views

Why is sudo slow when I mistype my password? [duplicate]

If I'm asked for the sudo password, after typing it in correctly, the terminal moves on almost instantaneously. However, if I mistype my password, it takes a few seconds before working it out and ...