Tag Info

Hot answers tagged

26

root is the superuser account on the system — it (basically) has all privileges. Many systems are configured so that you can use the sudo command in front of another command to run that command "as root" — that is, as if you are the root user, with the same privileges. It is usually the case that you need root privileges to install system packages, which is ...


9

su -c "command and args" username


6

It's best to first look in /etc/sudoers for lines that look like: ## Allows people in group wheel to run all commands %wheel ALL=(ALL) ALL ## Same thing without a password # %wheel ALL=(ALL) NOPASSWD: ALL It's the "wheel" group on CentOS and "admin" on Ubuntu. If you are OK with giving this user all root powers, just make them a ...


6

Sudo should provide you with the most common way to do this. Any member of the wheel group will have sudo rights by default. Putting it together you will want to add any user you want to have root privileges to the wheel group. They will then preface any command with sudo to run a command (and only that command) as root. At the end of the command they will ...


5

What does “are you root?” mean? In order to install packages systemwide (what apt-get does), it needs root privileges, since you will be creating and changing system files (root is the usual name for the *nix administrator account). The «are you root?» message is a gentle reminder that you "need to be root" in order to run apt-get install. This is the most ...


5

You need root privileges in order to execute system updates via apt-get. You can switch to a root account using su root. It appears that you do not have the sudo program installed.


4

sudo -u <user> -H <command>


4

In newer (and backported into RHEL 6) versions of PAM, there is an option to pam_cracklib you want to add — enforce_for_root. This is off by default. Just add it to that line, and there you go. Of course, without a lot of other constraints (SELinux, say), root can always go around PAM and set the password another way (like, writing directly to the ...


2

Even assuming you meant chmod g=u rather than chmod 770, it may well break some of the PAM security modules, including those that manage logins. It will break ssh logins, as ssh checks permissions on $HOME and all parent directories. If, as you suggest in your comments, you simply want to avoid using sudo there are some options that spring to mind: Login ...


2

Using sudo: #!/bin/sh ip -s -s neigh flush all ufw enable sudo -Hu username sh -c '"/home/back/Downloads/tor-browser_en-US/Browser/start-tor-browser" --detach || ([ ! -x "/home/back/Downloads/tor-browser_en-US/Browser/start-tor-browser" ] && "$(dirname "$*")"/Browser/start-tor-browser --detach)' dummy %k -H: Sets the $HOME environment variable ...


1

If I understand you correctly, you simply don't want to run HTTP as root. Either don't have Apache listen to port 80 and use IPtables to redirect those packets to a higher port number; or tell Linux that ports < 1024 are not secure. See the excellent answer at http://unix.stackexchange.com/a/10791/105631. Also here: ...


1

There are two ways to go about this. 1) Run the script as a non-root user and use sudo to raise privileges to the root user (prefix the commands to be ran as root with sudo). or 2) Run the script as root user and use su to run the tor command as non-root user. su allows you to stipulate what user to run the command as and the -c option to specify what ...



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