New answers tagged

1

Yes, sudo uses PAM and PAM supports configuration for each application. Authentication and logging The sudoers security policy requires that most users authenticate themselves before they can use sudo. A password is not required if the invoking user is root, if the target user is the same as the invoking user, or if the policy has disabled ...


0

The command that adds the repository is sudo add-apt-repository ppa:archivematica/1.4 If the add-apt-repository command isn't available on your system, the command won't work, and you will need to run sudo apt-get update sudo apt-get install python-software-properties and try again. However, there's no harm running those commands even if ...


0

in my case, find all the source in .list file, eg: /etc/apt/sources.list /etc/apt/sources.list.d/nginx.list /etc/apt/sources.list.d/passenger.list some source in the list are forced using https:// even if you changed it into http:// it will redirected to https:// the solutions is : backup and remove the https source first then run apt-get update run ...


0

Not "safe" at all. Running a command terminal as root makes everything you do (including mistakes) Very Powerful, and when you try (intentionally or not) to do something dumb, you're not protected by the restrictions placed on non-root users. Programs generally should not require root to run (the exceptions are programs that manipulate the system state: ...


13

When I reboot via the GUI I can do that without my sudo password. Only if you're the only one logged in. If there are any other users (including console users) you may have to enter a root password. This is the same on OS X and newer Windows versions. Why is that? What's happening internally of the ubuntu system there? The following command: ...


4

In a multi-user system, the last thing you want is your users logging in and being able to randomly reboot the server at any time, thus the command line version of Reboot is a superuser-only command, hence needing you to be root or have sudo rights. Ditto the Halt and PowerOff commands too.


0

Since running GUI applications as root is a Bad Idea, I'm not happy to give you this answer: Read man xhost, then do xhost +localhost.man xhost also show how to set up this permanently.


0

Just ran into this too. The Ubuntu installer prompts for a non-root admin user which gets added to the group sudo. I had then manually added myself to the sudoers file using sudo visudo: my_username ALL=(ALL:ALL) NOPASSWD:ALL But I still have to password authenticate. enzotib's answer is the key to what's going on. The group sudo shows up in sudoers ...


1

From your question, it is not fully clear if you need to be inside the directory of CMDexecutable (and thus cd first) or if the full path would do, but the only option I see is to add the script to the sudoers file, as described here. Then you can run the script with sudo, without having to enter the password. You can simply run the (python) script then by ...


0

Could you try giving the full path to forever when you start it for rc.local. Might be that the $PATH isn't set as it is you when you're logged in. Failing that, is there some log that forever produces? Can you tee to output where you run the command, like: /usr/local/bin/forever start <full path to>/server.js | tee /tmp/forever-start.log


2

A script in any (interpreted) language, like bash or python, needs to be "interpreted" by the interpreter of the corresponding language. On Linux, this can be done in different ways: The interpreter is "asked" to run the script by including the language in the command to run the script: <language> <script> or in your example: sudo bash ...


1

man sudoers says: A Cmnd_List is a list of one or more command names, directories, and other aliases. A command name is a fully qualified file name which may include shell-style wildcards (see the Wildcards section below). That is, you have to use the full path of commands. A bare word like service is an error.


1

It seems you are using csh shell as your root login shell. So you can either install the missing shell using @izx answer. Or just change the default login shell of your root to a valid, installed login shell. You can change the login shell of the root with command: sudo chsh -s /bin/bash root So now bash will become the login shell of root. You may ...


-1

Edit passwd with vipw Make sure the root shell is set to /bin/bash root:x:0:0:root:/root:/bin/bash


0

More than an answer is just a comment about this same issue it happened to me just a few minutes back (Jan 26 2016) where I was completing a lab and I entered a chmod 600 ~ command, so I lost access to my home, so I came to this article, and first tried the find commands and the terminal started reading everything, but it all ended in a permission denied ...


0

I think that the best way is to use EncryptedHome. For sensitive user accounts, create them using the option encrypt-home. Check the caveats on the page if it fits your requirements.


0

You can encrypt the files/folders using seahorse. It integrates well with Natuilus, and you can simply. Encrypt by clicking right and select encrypt Reference: http://askubuntu.com/a/27780/488702


1

Well, from what you told us, it should be working perfectly... That is if the partition it's stored on supports unix/posix style permissions. I run into this error all the time if I try to run a script from a vfat or ntfs partition. Considering it's mounted in a location called work, is this on a USB drive with fat or ntfs formatted partition? If it is, you ...


2

Open a file manager and click on the partition to mount it. Then, run the following command to gain full ownership of the partition and all contained files: sudo chown -R $USER:$USER /media/$USER/* or, sudo chown -R gsamaras:gsamaras "/media/gsamaras/a6cd1464-abf1-4a7b-b4a2-61f584d4cb32"


0

I don't if this will work in your situation but whats the harm in trying right ? why not create a user with the same name and uid as that hadoopuser sudo -i #adduser -u 1001 hadoopuser then try to access if didn't wroked which is the way it should become root sudo -i #chmod 666 foldername/ #chmod 666 foldername/* #chown -R yourlocaluser:yourlocaluser ...


0

I was also face this problem , and I solve this problem. Open Your Terminal And run the command, sudo chmod -R 0700 /var/lib/sudo hope your problem solve now


1

Will you give the output of this (from the directory where the abc.sh resides): $ type ./abc.sh $ ./abc.sh The type command will first verify that your ./abc.sh is found. If it isn't it will exit saying that it can't find the ./abc.sh file. Then we would have to find out what it is about the filename that it can't be found. Also, what is the name of ...


0

Copy the file ~/.config/pulse/cookie from the user running the pulseaudio daemon to the same location for the user that you are sudo'ing to.


0

The problem is that unless the filesystem of the device is like ext3 or ext4, (and probably it is FAT32 for you), the filesystem does not store much metadata about files, including the executable bit. When you do chmod +x yourfile, then ls -la yourfile, you will notice the executable bit has not in fact been set. The solution here is to cp yourfile ...


0

I should just wait for the editor to open, just like steeldriver said.


1

Had the same problem. In my case the executable was stored on a different drive which was why chmod+x was not working. I copied the executable to a Linux directory (like Desktop), set the permissions using chmod+x, ran the executable using "./" and it worked :)


2

Looking at Andre Herman Bezerra's answer, the only problem with this is pointed out in the comments this DOES NOT restrict the user to update only (they can install/remove packages). If you want to restrict a user to be able to update only you're better off doing the following. Create a group or use the %staff group. In this example, i'm choosing to use ...


0

From the following link: Fortunately, there is a way to solve this problem. Sudo has a configuration option that allows to keep given environmental variables from the user issuing the sudo command. The options is called env_keep and can be configured by changing the settings in /etc/sudoers files as follows (always use visudo to edit the file): visudo ...


1

Isn't this a big security hole? No. But yes, it is lowering security a bit in favour for convenience. You can secure a system with a 128-bit password, throw it away and nobody is ever going to get access to the system ... Secure? Yes. Convenient? Hardly ;-) Leaving a system unattended where sudo is active is. There is a solution to this: sudo -k ...


4

sudo settings by default have 15 minutes time out before reprompting for password, however one can change it to always ask for password every time you call something with sudo. The exact option is timestamp_timeout timestamp_timeout Number of minutes that can elapse before sudo will ask for a passwd again. The ...


2

sudo by default in a standard Ubuntu installation keeps the sudo access cached for a short time (default is a 15-minute timeout). For your hypothetical situation to work, you need to have run sudo earlier, and then run the code you specified with sudo before the caching of that ability times out. In most cases, this is not as 'insecure' as you think - many ...


1

The problem is in the environment set by the sudo command. The non-functional environment is set because of this line in /etc/sudoers: Defaults env_keep="https_proxy" Which affects the environment in different ways, such as: DISPLAY andXAUTHORITY not set (which cause the problem) HOME set to /home/root And probably in other ways as well. If you wish ...


4

You first command is not rightly put, perhaps you meant: echo "deb https://pkg.tox.chat/debian nightly release" | sudo tee /etc/apt/sources.list.d/tox.list Now let's undo the commands one by one: You can either rename or remove the /etc/apt/sources.list.d/tox.list file: sudo mv /etc/apt/sources.list.d/tox.list /etc/apt/sources.list.d/tox.list.bak Or ...


1

It is called when packages are broken, or the package installation is interrupted. You should run sudo dpkg --configure -a or its alternative apt-get -f install to solve this problem.


1

According to this and this, pkexec chmod 755 /etc/sudoers.d should solve the problem. pkexec seems to be a sudo alternative, so if you lose access to one of them, you can use the other to correct permissions. Like @GertOtten said, you would also have to kill the dpkg process. You can do so by rebooting or running sudo killall dpkg.


1

Try to chmod the file to 755. Maybe you would also have to reboot or teminate the dpkg process using the kill command.



Top 50 recent answers are included