sudo

Not able to delete a file even if using sudo command on ubuntu 22.04 LTS

Not able to delete a file even if using sudo command on ubuntu 22.04 LTS I have a text file Summary_DataTypes.txt which was created by me earlier. It appears in lsand vs code. But does not show in the folder even if I do show hidden folder. I want to delete this file but sudo …

Total answers: 1

How to check permissions of a non sudoers user with full root access?

How to check permissions of a non sudoers user with full root access? doas is a sudo-like command recently packaged in Debian 12, Ubuntu Jammy (universe) and some other Linux distros. A non sudoers user (doasuser) can be added to /etc/doas.conf to be granted root access. Detailed instructions on Debian Wiki. Problem: The doasuser isn’t …

Total answers: 2

sudoers NOPASSWD tag doesn't seem to work

sudoers NOPASSWD tag doesn't seem to work I’m working on adjusting a script I found here for my own purposes. In essence, the script checks some conditions, and then runs one of two commands using sudo. The command executes as the user cas. Since the script won’t run interactively, I want to ensure that the …

Total answers: 1

sudo: /etc/sudo.conf is group writable

sudo: /etc/sudo.conf is group writable I’ve made a mistake. List of commands that I typed: sudo usermod -a -G root erp sudo chmod g+w /etc setfacl -R -m u:erp:rwx /etc Then ssh.service of the virtual machine stopped working and when I type commands with sudo in terminal, it says sudo: /etc/sudo.conf is group writable. And …

Total answers: 1

Crontab doesn't open for user

Crontab doesn't open for user When I am trying to open crontab I see the next output: ubuntu@macaroon:~$ crontab -l crontabs/ubuntu/: fopen: Permission denied When I add sudo it opens fine however, if the jobs don’t work there: ubuntu@macaroon:~$ sudo crontab -l # Edit this file to introduce tasks to be run by cron. # …

Total answers: 2

Executing a shell script with sudo / no password

Executing a shell script with sudo / no password I got this line in sudoers: Cmnd_Alias NVIDIA = /sbin/sh -c ‘echo ON > /proc/acpi/bbswitch; modprobe nvidia; modprobe nvidia_drm modeset=1’ user ALL=(ALL) ALL, NOPASSWD: /sbin/systemctl suspend,NVIDIA My sudo -l shows me: sudo -l User user may run the following commands on devbox: (ALL) ALL, NOPASSWD: /sbin/systemctl …

Total answers: 1

Syntax error in sudoers file

Syntax error in sudoers file I wanted to allow my ordinary user to run /usr/bin/brightnessctl to turn on/off the keyboard backlight on my laptop, so I did visudo -f /etc/sudoers.d/grove (grove is my username, but all that matters here is that that file is included in /etc/sudoers) That file already contained these lines: grove ALL=(ALL) …

Total answers: 1

linux sudo list permitted commands

linux sudo list permitted commands Given that /etc/sudoers and /etc/sudoers.d/ are not readable by regular users, is there a way that I, as a normal user, can find out what sudo permissions I have? Asked By: mah454 || Source Run sudo -l. Depending on how sudo is configured on your system, it might request your …

Total answers: 3

why sudo delays 5s to 10s if WIFI is enabled? and how to fix it?

why sudo delays 5s to 10s if WIFI is enabled? and how to fix it? run this in terminal with internet off: while true;do sudo -n uptime 2>/dev/null;echo "`date`($((i++)))";sleep 0.1;done now turn internet on (WIFI here). The log will happen now every 5s to 10s… How to make sudo ignore internet? Also, why it behaves …

Total answers: 1

why "sudo copa" command not working, while "copa" commands works

why "sudo copa" command not working, while "copa" commands works I have installed homebrew with below instructions for ubuntu 22.04 https://owlhowto.com/how-to-install-homebrew-on-ubuntu-22-04/ Then I am able to install "copa" a Microsoft tool using command brew install copa https://project-copacetic.github.io/copacetic/website/installation#development-setup Now when I am trying to run the command copa, it’s working But when I tried with sudo …

Total answers: 2

How to restore /root/.bashrc as sudo su is giving segmentation fault (core dumped)

How to restore /root/.bashrc as sudo su is giving segmentation fault (core dumped) I’ve a dedicated remote web server. I messed up /root/.bashrc file by adding source /root/.bash_profile. It core dumps on sudo su. $ sudo su Segmentation fault (core dumped) I can’t login to server via ssh using root as well. I can’t do …

Total answers: 1

Can I install programs in linux from any directory?

Can I install programs in linux from any directory? I am using the latest Linux Mint 21.2. Can I install programs from any directory? For example, if I want to install vim, can I write sudo apt install vim in any directory and linux installs it correctly? For example, I make a random directory: /home/***/dir1/dir2/ …

Total answers: 3

sudo Acting Differently on Two Machines – same account

sudo Acting Differently on Two Machines – same account RHEL 8.8 on VMWare (eSXI) on two different VM’s (server01 and server02) So we have an administrative account in our AD "pfsadmin" used for various purposes including stopping and starting database brokers etc. It is a member of the group "progress" among others. Both machines have …

Total answers: 1

What does it mean to copy a command to a different name?

What does it mean to copy a command to a different name? Limitations of the ‘!’ operator It is generally not effective to “subtract” commands from ALL using the ‘!’ operator. A user can trivially circumvent this by copying the desired command to a different name and then executing that. For example: bill ALL = …

Total answers: 1

I lose permission every day at midnight

I lose permission every day at midnight I require a file at the top of my PHP scripts. The file just has connection object for MySQL: $c->new mysqli(‘host’,’usr’,’pass’,’db’) The file has 400 permission: -r——– and I keep it in /etc/mysql/ away from my webpage root (/var/www/html). It works fine, except every night at midnight it …

Total answers: 2

Ubuntu 22.04 "Bricked"

Ubuntu 22.04 "Bricked" I’m running Ubuntu 22.04, and after compiling an NXP Driver for another piece of hardware am no longer able to run almost all commands. Anything containing "sudo" or "ls" returns the following and does not execute: aarch64-binfmt-P: Could not open ‘/lib/ld-linux-aarch64.so.1’: No such file or directory I manually restarted the system and …

Total answers: 1

How to run a bash script by double clicking by entering the path in sudoers?

How to run a bash script by double clicking by entering the path in sudoers? Using sudo visudo I add the line username ALL=(ALL) NOPASSWD: /home/user/script.sh in sudoers but the script.sh does not run on double click. If I add the line username ALL=(ALL) NOPASSWD:ALL in sudoers then the script.sh runs and works when double …

Total answers: 1