Tag Info

Hot answers tagged

6

This is a choice. If you don't like it, you can use the -i or -H option, or change the configuration. The sudo(8) man page says for HOME: Set to the home directory of the target user if -i or -H are specified, env_reset or always_set_home are set in sudoers, or when the -s option is specified and set_home is set in sudoers. Actually env_reset doesn't ...


5

The point of a “graphical sudo” is to prompt for the user's password. If you don't want a password prompt, use plain sudo. Run visudo to create an entry in the sudoers file with the NOPASSWD tag. Note that this entry must come after any ALL entry. Make sure that the DISPLAY and XAUTHORITY environment variables are preserved, to allow running X11 ...


4

Test if you are root, and if not, restart with sudo, for example: #! /bin/bash if [[ $EUID -ne 0 ]]; then exec sudo /bin/bash "$0" "$@" fi


3

sudo command requires password of current user, not root user. If you wish to authorize by root password you can just use su -.


3

Try: Defaults timestamp_timeout=0 An example from man 5 sudoers, where a value is appended to an option: Defaults env_keep += "DISPLAY HOME"


3

traceroute need not run as root; it just needs the capability CAP_NET_ADMIN. Thus you can set this as file capability for the file and then traceroute will always have this capability (for all users, though), if your kernel supports file capabilities and no Linux Security Module (SELinux, AppArmor) is blocking it: setcap CAP_NET_ADMIN+ep ...


3

As root you can change any users password by using the "passwd" command followed by the username; passwd username This will then prompt you to enter the new password twice. To clarify there is no way to see an existing users password.


3

"arguments that cannot be located" typically means that the process has no command line arguments because it's not a normal user process but one started directly by the kernel. When you're looking for a process that's doing something wrong, it's usually not one of these kernel processes, so your colleague suggested filtering those out. tty is not "just a ...


2

See more here: http://www.linuxquestions.org/questions/linux-general-1/du-cannot-access-%27-proc-4972-task-4972-fd-4%27-no-such-file-or-directory%27-672916/ /proc is a pseudo filesystem; it's a part of your RAM and contains information for every >existing process. So, if a process does not exist anymore when du tries to count it, or if >a process has ...


2

By the very definition of what the root user account is, this account can do EVERYTHING & ANYTHING. It can completely destroy the system's filesystem and manipulate anything on the system. If you're going to do any experimentation such as this, you'll want to do it in a virtual machine, not on your bare metal system. Since this is a learning exercise I ...


2

No. It doesn't depend on it. If you call a simple task from rc.local, you shouldn't get this behavior. If you want to run a task as root in the background: this is what is called as daemons. There are more methods to do that, the 3 most probable: If the demon does something periodically, you can develop it as a crontab script. It is very clear, although ...


1

You can use SSH with X forwarding (-X) and a key without password. SSH has the useful feature that keys can be limited to one command. This could be a kind of sudo replacement: Prevent the user from doing as root what he wants; limit him to what he must be capable of doing.


1

I believe what you are trying to accomplish is making sure the user runs a script as root. To do this, you do not want to add it to the script, but instead just change the ownership of the file and the execute permissions. This can be done with: # chmod og-rx yourscript.sh # chown root:root yourscript.sh (by muru =]) or # chmod 750 yourscript.sh # ...


1

This is too complicated for sudoers. You have to write a script which checks whether the user belongs to this group and calls passwd if so. sudoers must then be configured so that john can run this script as root. Of course, the path to this script must be writable only for root. #! /bin/bash group="groupname" test $# -ne 1 && exit 2 user="$1" ...


1

If you have the sudo package try gksudo nautilus, otherwise use sudo mv -v /home/username/Desktop/script.sh /etc/profile.d/script.sh For more, try man mv sudo elevates the command following it temporarily to perform tasks like you describred.


1

Your failover system must have some network characteristic that distinguishes it from the real one. Unless you have an especially complex setup, the two servers have different IP addresses. On the recipient machine, check the earliest (last) Received: header: this header indicates which machine sent the email (from the perspective of the first hop). Use a ...


1

Change the 'From' text by editing /etc/passwd to receive mail from 'root at failover' instead of just 'root'. chfn -f 'root at failover' root source: https://wiki.archlinux.org/index.php/SSMTP


1

Frankly it sounds a bit silly. grep -Ev "[[]" excludes processes having the opening square bracket in their command. While these are often kernel processes, even a regular user space program can have that character present on the command line. grep -Ev "tty" is the same in pale blue. It excludes processes having the string "tty" somewhere on their line ...


1

You can prevent all users and even root user to login to system if you delete /etc/passwd file. Deadly commands that can ruin your system



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