Hot answers tagged

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 ...


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 ...


3

sudo is unuseable, but you still have pkexec. So: pkexec chmod 440 /etc/sudoers


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 ...


2

sudo will ignore any aliased commands from .bashrc. You can work around this by creating an alias for sudo too --> alias sudo='sudo ' You need the space after sudo, since man tells us: If the last character of the alias value is a blank, then the next command word following the alias is also checked for alias expansion.


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"


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 ...


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

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


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 ...


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

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 ...


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 ...


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 ...


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 ...


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

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 :)


1

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 ...


1

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


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

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.



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