Tag Info

Hot answers tagged

28

I think the fastest way to fix this would be to get a root shell from the recovery mode and to move the original /etc/sudoers back in place: Hold LSHIFT at power-on to boot into grub Select the default kernel's recovery mode (e.g. Ubuntu, with Linux 3.19.0-15-generic (recovery mode)) and hit Enter Select root - Drop to root shell prompt and hit Enter Run ...


9

Since Ubuntu also has pkexec installed, and Polkit configuration is independent of sudoers: pkexec mv /etc/sudoers{.bak,}


9

Oh I've done this one before. :) oops... Reboot using a LIVE CD (The one you installed Ubuntu with) Choose the "Try Ubuntu" option NOT the "Install Ubuntu" option. Once you are to the desktop just mount your main HDD (should show at the bottom left as a hard drive) Launch the file manager and navigate to the /etc/ folder on that newly mounted hard ...


7

No. It'll work with the next sudo command.


4

Because you are dealing with a Java program, you specify the directory it should see as the home directory by setting the system property user.home: sudo java -Duser.home=$HOME -jar this.jar It is confusing that this should be necessary. Since sudo by default retains the value of HOME, one would expect Java to set user.home to $HOME. However, the Java API ...


4

You are referencing the same file twice in the pipeline, tee will overwrite the file before awk gets to it. Either use a temporary file or use sponge from moreutils. Recent versions of GNU awk, 4.1.1, have a -i inplace argument which simulates editing file in-place:


2

That your awk/tee adventure does not work reliably, which has already been said here. ;) You could try another way: drum-roll Use the power of perl! again drum-roll sudo perl -i.bak -0777pe 's/(<Directory \/var\/www\/>([^<].*\n)*.*AllowOverride\s)None/$1All/' /etc/apache2/apache2.conf -i.bak in-place edit and create a backup ...


2

When you run apt-get --dry-run without sudo, you get a warning: NOTE: This is only a simulation! apt-get needs root privileges for real execution. Keep also in mind that locking is deactivated, so don't depend on the relevance to the real current situation! So it is better to use sudo to get a real testing.


2

I'm not a zsh user, but sudo zsh -c test1 is failing because the shell has not read your .zshrc file. Try this: sudo zsh -ic test1 That should tell zsh that this is in interactive shell, so source the .zshrc file.


2

Change the line in the sudoers file to: kf ALL=(ALL) NOPASSWD: /sbin/fstrim I don't recommend, adding the script in /etc/sudoers, because the script can be altered and every command (the whole script) would then be executed with root privileges.


1

In Ubuntu setup, you cannt set a blank password. That's how UNIX and UNIX-like operating systems work to protect some of the administrators functionnality that can affect the system. So there is a password and you have to find the one that set it up.


1

Boot from a Live USB or CD, remount your / disk partition rw and look at/fix (on the disk filesystem, which I will assume you mount at /mnt/tmp) /mnt/tmp/etc/sudoers and /mnt/tmp/etc/sudoers.d/*


1

login with root user using su - root then run command usermod -a -G sudo username or run command visudo and paste username ALL=(ALL) ALL if still you face problem then run command mount -o rw,remount / and try again above method also, you are saying. you able to run command sudo adduser chauhan sudo then you can do this way also ...


1

First, a note about the security systems involved: sudo and gksudo are governed by sudoers, but much of the GUI uses polkit, whose configuration is independent of sudoers. There are not many common factors: Ubuntu uses the sudo group to grant administrative privileges in both systems. Both support PAM, so PAM configuration can affect both. In particular, ...



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