sudo - Execute a command with superuser privileges.

learn more… | top users | synonyms

0
votes
0answers
26 views

Can't use su on Archlinux [on hold]

I have a problem using su in my arch linux. I can use sudo without a problem and the sudoers file is correct setted up. If I try to use su like su - I am getting this error: su: Fehler bei ...
0
votes
0answers
23 views

I want to pass the password for sudo user from a file in putty

I am passing the sudo user command from a file as soon as sudo user command passed to putty system prompted password. I am trying to pass the password for the sudo user but system not able to read ...
0
votes
2answers
54 views

Combination of tee and tty [on hold]

I tried the below command, I read it from a book sudo ls | tee /dev/tty3a This command gives to me Permission denied, even with sudo. Here tty is the teletypewriter, I know this already. But what ...
1
vote
0answers
76 views

sudo kill: Operation not permitted over SSH

Using heredoc to execute multi-line commands on a remote machine. Trying to get pid of a server to kill that server located in the remote machine #!/bin/bash HOST_IP="10.180.5.23" read -p "For HOST ...
1
vote
1answer
51 views

Edited sudoers, but `sudo ls` fails

A user has been added with root access in the /etc/sudoers but, it seems that it can not run sudo commands. [root@compute-0-0 ~]# cat /etc/sudoers root ALL=(ALL) ALL hduser ALL=(ALL) ...
1
vote
1answer
23 views

login with apache user

I'm following this tutorial step by step,for Here we clone the repo into a chmodded /var/www/[site_dir] folder. Note that we switch to the www-data user before running the git clone command. ...
3
votes
2answers
28 views

Get iSerial with lsusb without sudo

Under my sudoer user (non-root), I can see my device with lsusb. However, to see the iSerial number, I need to issue lsusb -v, I do get a lot of information printed, but the message "Couldn't open ...
1
vote
1answer
27 views

Why would root need to run unrestricted commands as itself via doas?

I've just come across doas, and while reading the man page for its configuration I found this example: The following example permits users in group wsrc to build ports; wheel to execute commands ...
1
vote
1answer
30 views

What do I need to have inside of my sources.list file?

I can't download a thing. When I run sudo apt-get for any program I get the error Package [insert name here] has no installation candidate. I've looked online and there are hundreds of ...
1
vote
0answers
40 views

Why can't I install bc on my Raspberry Pi? [duplicate]

When I try to run the command sudo apt-get install bc I get the following error message: Reading package lists... Done Building dependency tree Reading state information... Done Package munin-...
1
vote
1answer
44 views

Su as root and run command in one line

I need to su as root and run a command as a single line. This is for use in a python script. What I am looking for is: $ su root [some-magic] sh /home/jay/script-that-needs-executing-as-root.sh <...
0
votes
0answers
22 views

How to create a sudo user in linux? [duplicate]

I want to add a sudo user in my account but whenever I try to intall ssh connection, it shows user not in the sudoers file. How do I proceed ? I created my user using this- sudo useradd -m username ...
6
votes
1answer
88 views

How does sudo work (besides setuid)?

sudo is elevated to root upon launch because it's binary has a setuid enabled. But when I give /bin/login the exact privileges sudo has, and I try to run it from a user that isn't root, I get the ...
-1
votes
2answers
36 views

Privilegies of command inside shell script

I need to run simple script to check host status (ping), I have following script: #!/bin/bash echo "Host checker:" if [ "`ping -c 1 172.17.10.1`" ] then echo "HOST UP" else echo "HOST DOWN" fi ...
6
votes
7answers
357 views

How to secure a sudo - powered script

Solution for executing root commands as unprivileged user - sudo 'ing script - easily opens possibility of security breach and unexpected behavior and results (this is also true for any other solution ...
1
vote
2answers
42 views

Use root privilege without password

I am on Debian 8 and I am searching for a command in debian to use root privilege without password. I am asking because I already saw it somewhere but can't find it anymore.
1
vote
1answer
26 views

How can I make sudo discard all environment variables? [duplicate]

People usually want to preserve their environment variables while executing sudo for various reasons, but, there are some cases where discarding environment variables makes much more sense. For ...
1
vote
1answer
43 views

Which PATH does `sudo <command>` use to search for `<command>`?

I installed eclipse in my home directory, and put its path in PATH in ~/.profile. So it works by $ eclipse But when call it with sudo, eclipse isn't found: $ sudo eclipse sudo: eclipse: command ...
3
votes
1answer
214 views

How do I access a folder which I can't sudo cd into?

I'm trying to change my directory to /boot/efi, but running sudo cd /boot/efi does nothing. I'm on fedora 23. Is there a more powerful command for this?
4
votes
1answer
105 views

Sudoers: Allow any subcommand for certain argument

I'm trying to allow a group of users to gain some control over an instance of a dhcpcd service. In other words I would like to have them be able to run: systemctl (start,stop,...) dhcpcd@eth0.service ...
0
votes
0answers
32 views

How to fix system after wrong permissions? [duplicate]

I changed permissions on / by mistake using chmod -R 755 /* instead of ./* after doing sudo -s. I stopped the process in the middle of it after realizing what was going on. But it was too late. Now ...
1
vote
1answer
48 views

Sudo, no access to user files

I installed the newest version of Debian and have no access to my own files when using the sudo command: ls -> shows files in my home directory sudo ls -> permission denied My user is part of ...
-1
votes
0answers
71 views

What is the difference between “sudo su -” and “sudo su -l”?

On Xubuntu 14.04, looking at the man pages, su - and su -l should be the same. -, -l, --login Provide an environment similar to what the user would expect had the user logged in directly. I ...
0
votes
1answer
25 views

How to give a particular use's privileges to another user in Debian?

Lets say in my Debian PC have 2 users called cat and dog. I want to use sudo setup to give dog's privileges to cat. So cat can do what dogs do. I'm new to sudo stuff but I tried below config. It ...
1
vote
1answer
28 views

No sudo after using `visudo -x` option

visudo warned me about syntax errors so I exited without making changes. I decided to create a new file within /etc/sudoers.d instead. Unfortunately, I didn't pay quite enough attention to the manfile ...
0
votes
1answer
36 views

adding a sudoer in debian

After a long search on the web, trying everything I can find I came to ask you guys, how can I add an existing user to be a sudoer? I've tried usermod -a -G sudo user and also adduser user ...
0
votes
1answer
30 views

Echo while waiting for sudo prompt

Context I am using this way of elevating permissions in a script if not run as a root. My Bash script checks for the presence of a certain file it needs to use: if [ $EUID != 0 ]; then if [ -f "...
1
vote
0answers
57 views

How to send sudo password over pipe? [duplicate]

I need to replace existing sshd config on the remote PC and restart sshd, so I try to use this: cat /sshd_cfg | ssh user@192.168.0.47 "cat > /etc/ssh/sshd_config && service sshd restart" ...
7
votes
3answers
616 views

Can vim edit a remote file as root?

I've found this question that explains how to edit a remote file with vim using: vim scp://user@myserver[:port]//path/to/file.txt Is it possible to do this as root (via sudo) on the remote host? ...
0
votes
2answers
57 views

Linux Debian Jessie sudo command keeps asking for password

I have recently configured a Symfony 3 site which involved me to set up some permissions on the /var folder. I had to do the following: $ HTTPDUSER=`ps axo user,comm | grep -E '[a]pache|[h]ttpd|[_]...
1
vote
2answers
74 views

`sudo: command not found' when following a tutorial for Let's Encrypt

I'm following a Godaddy help tutorial in order to install Let's Encrypt certificate for my website. So I connected to my server using ssh via Putty. Typing the command sudo git clone https://github....
0
votes
1answer
107 views

Difference between sudo user and root user [closed]

The /etc/sudoers file lists which users can do what with the sudo command The root user creates and modifies the /etc/sudoers file. This concept is difficult for me to understand. If all users ...
3
votes
1answer
41 views

Questions about sudo

I have a couple of questions on using sudo: Give Ben sudo access to the machine Give Tim sudo access to the following tool : iptables For (1) I just address Ben to the sudo group. So I did: ...
2
votes
1answer
59 views

using sudoers to allow non-privileged user to restart apache

We have production centos servers that run apache as root to allow low port numbers (80 and 443). We'd like a secure way for non-root users to restart apache. Are there any security implications ...
2
votes
0answers
30 views

How to allow traceroute to run as root on ubuntu

I'm trying to programatically call traceroute on Ubuntu but i'm getting blocked when trying to use the -I or -T flags for ICMP/TCP packets. Accroding to this question I can use the terminal command ...
3
votes
1answer
74 views

PAM failing to authenticate sudo, after successfully contacting ssh-agent

Setting up PAM sudo authentication, using ssh-agent, on 14.04.1-Ubuntu server LTS. I'm still unable to successfully authenticate sudo, via the ssh-agent, using PAM. Here are my relevant /var/log/...
2
votes
1answer
66 views

Submit password with sudo and execute script with nohup

I would like to download and run a script in the background so the task is independent of the shell and its exit. Moreover this script should be run as sudo, using: echo MY_PWD | sudo -u MY_USER -S .....
2
votes
0answers
14 views

run gvfs-mount as user in a script owned by root for networkmanager dispatcher

I'm trying to create a script to auto mount using gvfs-mount for NetworkManager dispatcher. The dispatcher requires the script to be owned by root. Running gvfs-mount smb://path/ works in terminal as ...
7
votes
3answers
315 views

How to harden su with dpkg-statoverride?

I am reading an Ubuntu 14 hardening guide and this is one of the suggestions: It generally seems like a sensible idea to make sure that only users in the sudo group are able to run the su ...
0
votes
0answers
36 views

Systemd, start user level unit with sudo access.

I have a debian package which installs my software and it needs to start two applications in post install script. First one is daemon and the second one is a background process both are managed with ...
1
vote
1answer
81 views

notify-send from root cron

On my system, notify-send requires 3 enviorment variables to run, which are kept in a file which is generated automatically on logon: /home/anmol/.env_vars: DBUS_SESSION_BUS_ADDRESS=unix:abstract=/...
1
vote
1answer
53 views

Why super user is disabled in iOS and Android

I know that both iOS and Android are based on UNIX. Then why is it that super user is disabled in both of them? In iOS we have to jail break and in Android we have to root. On the other hand in OS ...
-1
votes
3answers
47 views

Run su -s with arguments

I run to run a command using the su -s command to start a process. Since I do not want the root user to own the process. I try to do this by issuing the command su -s "$CATALINA_HOME/bin/catalina.sh ...
2
votes
3answers
135 views

Why can I switch to a user but not run a script as it

If I try to switch to a user using command sudo su - kshitiz. It works fine and switches without asking for a password. But if I try to run a script as that user it asks me for a password. sudo -u ...
1
vote
1answer
109 views

How to Fix empty /etc/sudoers as root?

I did root@masi:~# visudo -x /etc/sudoers root@masi:~# exit logout masi@masi:~$ sudo apt-get install vim >>> /etc/sudoers: syntax error near line 1 <<< which I get because the ...
1
vote
1answer
53 views

sudo NOPASSWD is ignored [duplicate]

I want to be able to run the pm-suspend and pacman without sudo to ask me for a password for all users in the group sudo. I added the following line to my /etc/sudoers configuration following this QA:...
4
votes
1answer
89 views

sudo takes too long to start

I'm using Fedora 23, the same problem was on Fedora 22. Sudo takes ~20 seconds to start, it doing something for ~20 seconds then asks password. Reboot solves this problem for a while. After a few ...
2
votes
3answers
73 views

Problem with sudoing ssh - `sudo ssh …` fails

I am trying to use git salt ssh access (which runs with root). The error is always: Permission denied (publickey). I managed to reproduce the problem, simulating what salt may be doing, by ...
1
vote
1answer
26 views

Alias that runs a command using sudo

Im always running a particular app as root because it requires more privileges. I usually just sudo it. I want to make an alias that is something similar to: alias myCmd='sudo nohup /path/to/binary &...
0
votes
1answer
143 views

Failed to syncronize cache for repo 'fedora' … (possible proxy issues)

I just started on a fedora build. Just managed to add myself to the sudoers file, so now I am attempting to grab vim. I do a sudo dnf install vim and get hit with the following error message. ...