Questions tagged [sudo]
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.
334
questions with no upvoted or accepted answers
1
vote
0
answers
160
views
Installing SSL on Shared hosting server
I have beta invitation of letsencrypt.org I followed there documentation here . But i am unable to install there packages because i have shared hosting server which does not allow to use sudo commands....
1
vote
0
answers
7k
views
"sudo: no tty present and no askpass program specified" error
I am getting "sudo: no tty present and no askpass program specified" error while executing command like "sshpass -p password ssh user@remote sudo ls".
Can one help me out... I tried it over few PCs. ...
1
vote
0
answers
393
views
Can't use sudo when autologin in Arch Linux
I have a Pandaboard running Arch Linux, the default non root user is alarm. I'm trying to automatically login at startup with the alarm user. I followed the instructions here and created the file /etc/...
1
vote
2
answers
273
views
Set a specific password for sudo
Would it be possible to set a password different from the user one and the root one?
I find that asking for the user password kind of useless and the root one, even more, just give him the root ...
1
vote
0
answers
708
views
Restrict an admin user from using sudo on os x
I have multiple admin users on my mac. Is there a way I can block a particular admin user from executing sudo on OS X?
My understanding is that if the user name is "abc",
abc ALL=(ALL) ALL
in /...
1
vote
2
answers
64
views
Root Privileges and Risky Commands
user ALL=(ALL) /usr/bin/vim /etc/httpd/confs/httpd.conf
user ALL=(ALL) /usr/bin/less /etc/httpd/confs/httpd.conf
I think if these scripts are written in sudoers, "user" can cause problems on the ...
1
vote
0
answers
809
views
sudo --set-home decide based on command
I was wondering if there is a way to make sudo set the --set-home flag based on the command being executed.
e.g. in most cases I do not want the --set-home flag to be set, but for npm, I want it to ...
1
vote
0
answers
1k
views
How to rsync root files over non-root ssh?
I have two machines, both providing no root login, but provide sudo root access.
Now I like to initate a rsync transfer of root files over ssh. Is there an easy way make the the root access given by ...
1
vote
0
answers
193
views
Run chromium as different user - Cannot download files
For security purposes, I'm running chromium with a UID different from my main desktop user.
user="web"
xhost +SI:localuser:"$user" > /dev/null
sudo -u "$user" -H -E -s -- chromium
With sudo ...
1
vote
0
answers
688
views
Deny access to a specific folder for a sudo user
So here is the case: I am root in an Ubuntu system. I want to give a user (say username is X) permission to execute any command but at the same time I have a folder that I want no one to be able to ...
1
vote
1
answer
793
views
Allow unprivileged user access to specific privileged files
I have a system running hardened Gentoo and I have installed Xorg, Fluxbox, and Conky together to create a minimal window manager desktop. Within this system I have 2 main users, root and my normal ...
1
vote
0
answers
1k
views
Samsung Chromebook series 3 sudo password
I cannot for the life of me find the sudo password for my chromebook. I have it in dev mode on Chrome OS 41. I want to install Arch Linux ARM onto an SD card but the instructions here http://...
1
vote
0
answers
6k
views
sudo - /etc/sudoers is world writable on Ubuntu OS
By mistake I change the permission of /etc/sudoers file on Ubuntu OS, now when applying any command using sudo, its giving error,
sudo: /etc/sudoers is world writable
sudo: no valid sudoers sources ...
1
vote
1
answer
1k
views
sudo cp with wildcard syntax doesn't do anything in Linux
I have a directory containing files that are owned by root, from this directory I wish to copy all the files ending with errorAll to another directory. My wildcard syntax is correct because performing ...
1
vote
1
answer
248
views
Replacement for "su user_with_sudo; sudo -s" for user without sudo-rights?
Let's say I have two user accounts:
user (without any sudo permissions)
user_with_sudo (with all sudo permissions)
Now, I'm logged in as user but want to do something as root, e.g. switch to a full ...
1
vote
0
answers
1k
views
Is there anyway you can restrict users from executing a command with another name?
I'm not asking an obvious question here. I would like to elucidate with an example.
A user 'bob' is always executing 'chmod 777 /home/bob/impfiles' so that user 'alice' could make changes to the ...
1
vote
1
answer
336
views
execute script with sudo and check security
I have a script, which I need to execute with sudo.
#!/bin/bash
cp "$@" /destionation/dir
Is it a good script or someone can bypass the restriction destination dir ?
Thanks for suggestions.
1
vote
0
answers
145
views
Broken sudo commands
How to repair sudo to use standard commands?
I cannot use any command with sudo.
1
vote
2
answers
951
views
Ubuntu lost Sudo password
After a disk crash someone reinstalled Ubuntu for me. My su password works. They said they used no sudo password, but that doesn't work, and nothing else works. Can I reset the sudo password from ...
1
vote
0
answers
4k
views
What is the different between "sudo su" and "sudo bash"?
In Ubuntu 13.10, for the default setting, the following command in Terminal
user@host:~/path$ sudo su
results in entering an prompt
root@host:/home/user/path#
And this command
user@host:~/path$ ...
1
vote
0
answers
109
views
sudoers syntax for specifying a list of executables
I want my user (username "wim" in group "wim") to be able to use sudo apt-get and sudo dpkg without needing admin password.
I tried editing sudoers file with sudo visudo, and I added in this line:
...
1
vote
0
answers
333
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 ...
1
vote
0
answers
1k
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)
...
1
vote
0
answers
515
views
why sudo create directories in wrong permission drwxr-sr-x?
I run sudo on ArchLinux(on x86_64) and Fedora(on sh4 cpu). They behavior different.
sudo mkdir x
ls -l x
It shows drwxr-xr-x root root x on ArchLinux.
But shows drwxr-sr-x root mygroup x on Fedora ...
1
vote
1
answer
1k
views
I get error when I try sudo apt-get update command on Ubuntu 12.10
This is the following error:
W: Failed to fetch http://ppa.launchpad.net/sun-java-community-team/sun-java6/ubuntu/dists/quantal/main/source/Sources 404 Not Found
W: Failed to ...
1
vote
0
answers
148
views
I can't get through with my password on sudo, can anyone help me?
I know that the password doesn't show up on the screen that's all good. I just can't seem to get any further as I am typing my user password but this comes up:
2012-12-04 22:38:14.815 TextEdit[27507:...
1
vote
2
answers
1k
views
how to invoke a shell function with sudo permission
There is a shell function add_book in my .zshrc. I need to invoke this function with sudo permission. But when I invoke sudo add_book I get the following error:
sudo: add_book: command not found
...
1
vote
1
answer
1k
views
admin group disappeared; cannot groupadd
Okay, so this is embarrassing, but I seem to have lost the admin group on my machine, though I would have sworn I hadn't gone anywhere near it. I'm running Mint Maya.
Trying to innocently sudo this ...
1
vote
0
answers
1k
views
sudo prompts for password over ssh
I have sudo set up for a user (myuser) as follows on "hostname" (sudoers content):
myuser ALL=(suser) NOPASSWD: /path/script*
this works fine, so I can run the following, logged in locally as myuser ...
1
vote
1
answer
3k
views
How to run python script on startup with sudo permission on Mac OS
I have created a script with python that basically ping all servers found in my lists. I need this script to be run on startup with sudo permission.
So the question is, How do you run the script on ...
1
vote
1
answer
411
views
Strange sudo message at startup
I have Kubuntu 10.04 LTS, and since I installed it on my computer, I get a password prompt after login. I can use the computer without any problems if I don't enter the password there, so I usually ...
1
vote
1
answer
81
views
Sudo does not log me in as root, but as "untitled 1"
I was changing multiple configuration files and used sudo -s to make myself root for a little while.
However, after running whoami I was not root, but untitled 1.
joseph@MacBook-Air (ttys000) /...
0
votes
0
answers
18
views
sudo visudo in a Dockerfile with CentOS base image
I am creating a Dockerfile using the centos:7 base image. I need to edit the file at etc/sudoers and append NOPASSWD privileges to it for a new user and some groups.
I have looked up in forums that ...
0
votes
0
answers
22
views
Validating Changes to pam.d (like visudo)
I'm working on an Ansible task for setting fingerprint sudo usage in MacOS. This is done through a custom rule in /etc/pam.d/sudo_local.
Is there a method to pre-validate edits to PAM for safer ...
0
votes
0
answers
120
views
start non-root user systemd and systemd services via sudo without enable-linger
I'm like to be able to start a systemd session (e.g. systemd --user) for a given non-root user, and subsequently start a service (e.g. systemctl --user start SERVICE.service), all via a sudo -iu USER ...
0
votes
0
answers
23
views
Mac's sudo not sanitize PATH from user's setting?
Mac's sudo behaviour is unlike everywhere else, of which just like observed in Passing PATH through sudo, sudo would flush PATH every time.
However, I found in Mac, my PATH setting is carried into ...
0
votes
0
answers
45
views
Zipping a folder and sub-directories not working without sudo?
I wrote a python script using Amazon's AWS Boto3 SDK to download files from an S3 bucket and puts them in a folder (in a directory within my home dir). For reference, the function I used was the s3 ...
0
votes
0
answers
132
views
Running App as root using Apple Script?
I am trying to use an Apple Script to run an application as root without asking for password all the time. I used this Apple Script code:
do shell script "/Applications/MyApp.app" user name &...
0
votes
0
answers
278
views
Google authenticator MFA codes aren't working in Linux
I want to enable MFA to use sudo commands on my laptop running Debian. I followed steps to enable this, and had the verification codes working for the desktop log in. But in terminal it keeps saying &...
0
votes
0
answers
54
views
Can I give a directory back to superuser?
I'm on macOS Sonoma. I was installing some Python and C packages in Homebrew, and it asked me to run:
sudo chown -R username /usr/local/opt
And:
chmod u+w /usr/local/opt
Now that I've installed the ...
0
votes
1
answer
245
views
sudo passwd for bash terminal
I am total newbie so excuse the lack of knowledge, but I recently created an Microsoft Azure account so it comes equipped with a bash terminal. I wanted to make sure it is up-to-date so I tried ...
0
votes
0
answers
143
views
Shell script run by launchd in MacOS can't create at job
I'm using the privileges.app to grant users temp admin privileges.
Because I need to have password auth and justification enabled via config, I can't use the build-in feature to limit the duration of ...
0
votes
0
answers
55
views
Very weird linuxbrew installation issue
I am installing linuxbrew in a linux machine. I typed
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
in the console. However it says
==> /...
0
votes
0
answers
63
views
How did this usage of chmod break sudo access?
In many other topics, I have seen people breaking their sudo access with commands such as
sudo chmod -R 777 /
and variants. Thinking I was doing it right, I have executed the following commands on a ...
0
votes
1
answer
150
views
Trigger a ZSH function when a command calls for sudo password
I quite often run into a situation where a long running system upgrade gets stuck on getting a sudo password, most often because the time for the last input has expired and I simply forgot about the ...
0
votes
0
answers
184
views
Using ctr run gives error on starting a container
I am starting a container using the docker run command, it works fine. However when I try to start the same container using ctr command (irrespective of whatever snapshotter I use) I get this error:
...
0
votes
0
answers
318
views
Ansible not able to execute command with sudo privileges, but the command work when launched manually
I'm kinda stuck on this: I'm trying to automate some task on a target MacOS machine, but the commands that need sudo work only when launched manually, and not with Ansible.
An example of a pretty ...
0
votes
1
answer
581
views
Getting error while downloading Java
I am trying to install Java in my AWS EC2 instance by using this below command:
sudo yum install java-1.8.0-openjdk-devel
But I'm facing the below error:
No match for argument: java-1.8.0-openjdk....
0
votes
0
answers
832
views
Ubuntu password no longer works after login
I recently installed Ubuntu 22.04 on a laptop and something weird happened to my password. I can only use it to login when I select a user (the booting GUI) and after that, things like sudo or ...
0
votes
0
answers
1k
views
How to use sudo with sftp through winSCP?
I found a few sources stating that I can use SFTP with a sudo user through an SFTP client (specifically winSCP). This link outlines all the steps I need to take, and it's still not working (https://...