Hot answers tagged

22

After some experimentation, I found the answer. To set options such as mail_always or root_pw for specific users, you can add a line like this to your sudoers file after opening with visudo: Defaults:USER_NAME mail_always Just make sure that this line is inserted near the top, where the other Defaults options are. In addition, if you want to specify the ...


17

Don't add the specific user you don't want to give sudo access to sudo group. sudo uses the configuration file /etc/sudoers and all files under directory /etc/sudoers.d/. By default, the line in /etc/sudoers that dictates this behavior is: %sudo ALL=(ALL:ALL) ALL Means all users of the sudo group can execute any command as any user on the system. For ...


4

You can first try to just copy the default .profile from the original copy found in /etc/skel/: /bin/cp /etc/skel/.profile /home/<username>/ If for some reason that does not work, you can follow the next part to replace your .profile from its original contents: Boot your system to Recovery Mode first so that you have root capabilities to your ...


4

Suggesting this is a dupe assumes adding Arduino to the sudoers file is a good idea, which it isn't. Never add an application that potentially ruins your system, or edits code to ruin your system to the sudoers file, simply because it as a security risk. Only add applications or scripts to the sudoers file if: the code cannot be edited (stored in a ...


3

It's for Security purposes you will be not able to see anything when you are typing your password, so that others can't guess your password by looking at number of characters or so... You just type your Password and type enter. To install an application we are supposed to use the sudo apt-get install command followed by the name of the package one wishes ...


3

The repository file needs to be fixed for PlayOnLinux. Copy and paste the following lines in a terminal window to replace the existing repository file: wget -q "http://deb.playonlinux.com/public.gpg" -O- | sudo apt-key add - sudo bash -c 'echo "deb http://deb.playonlinux.com/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/playonlinux.list' sudo ...


3

Why not just run the script as superuser? sudo sh recover.sh


2

I could reproduce the problem by deleting the GPG key 1118213C of the Graphics Drivers Team. Adding ppa:graphics-drivers/ppa again should solve the issue. Execute : sudo apt-add-repository ppa:graphics-drivers/ppa Why does it work? While adding the Launchpad PPA back, you see : gpg: requesting key 1118213C from hkp server keyserver.ubuntu.com


2

Alright, I haven't tested this (so use at your own risk), but it still might work. I Will test this in a virtual machine when I get the chance to: First, in a still working system, I did the following to get all file permissions in a list, skipping the /home/ directory: sudo find / -not -path /home -printf "%m:%p\0" > /tmp/fileper.log This will print ...


2

You should use root account or sudo when you want to change/install/fix packages with apt-get or apt or dpkg.


2

The -i option causes sudo to run the command in the shell specified by the target user's (in this case, root's) login shell, as you can confirm for example by running $ sudo -i sh -c 'echo $HOME' /root So it is telling you there is no Downloads directory in root's home. If you want to run commands as root but in the invoking user's environment, use sudo ...


1

I had the same issue with an other key. Like Serverus Tux already said, try to add the missing key. It solved my problem. sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys FCAE110B1118213C


1

I found the solution. We needed to set the login shell and path to the sudoers entry for the service user's home like so: %domain.local\\service ALL=(service) NOPASSWD:/bin/bash, /opt/service/* Now we are able to enter the following to become the service user: $ sudo -i -u service $ whoami service $ pwd /opt/service


1

Not sure if this makes you feel better, but what you are observing doesn't occur in Ubuntu 16.04. It does occur in Ubuntu 15.10 (which is what I presume you're using...or perhaps something older?). Fortunately, I have a 16.04 and a 15.10 machine to try. Under 16.04, I only have to enter the password once. Not sure where the difference is, though. I just ...


1

Copy the .desktop file and edit the copy with gedit (or any text editor), i.e. by opening the editor and dropping the file into the editors window. You will see a line beginning with Exec=, something like Exec=/path/arduino. This line needs to be modified accordingly, then save the changes. If you want to read more about desktop files I recommend: ...


1

You should try $ sudo -E matlab This will tell sudo to preserve your environment variables. If this doesn't work, Matlab is probably loading a configuration file from /root instead of /home/username. You can check where the configuration is located using the prefdir command in Matlab. I believe it is located under /home/username/.matlab


1

To solve issue one you need to be in a user terminal not a root terminal when you make the command. The command sudo -s -u www-data is changing the user to www-data but in the root home directory which .bashrc is not accessible to the user www-data. The second issue is that your /var/www directory has the wrong permissions and is set for root as owner ...


1

You can use... echo password | sudo -S recover.sh Password being your sudo password. From sudo manpage.. -S, --stdin Write the prompt to the standard error and read the password from the standard input instead of using the terminal device.


1

Not sure if the issue you describe is caused by those entries, but here is how to revert them: Open a terminal and type the following command: pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY gedit /etc/fstab (best copy the command and paste it into the command line by pressing CTRL+SHIFT+V). You will be asked for your password. This will open the ...


1

I think if you implement @rosuav's answer and then try sudo /bin/systemctl restart unicorn_my_app.service you will find you are not prompted for a password, and it does indeed restart your service. Hope this helps.


1

The answer above is correct. But if the launcher that launches your synaptic is pkexec, you can change it by editing the synaptic.desktop on /usr/share/applications folder and change the Exec= synaptic-pkexec command to Exec= gksu synaptic %u then save it. By pressing ALT + F2, run gconf-editor , go to apps and gksu mark sudo-mode. That may do. You can ...



Only top voted, non community-wiki answers of a minimum length are eligible