42 votes
Accepted

How is sudo safer than directly using su if the user is granted access to all commands?

Personally I do not necessarily consider it safer and most of the benefits (of sudo) are on a multi user system. On a single user system it probably is a wash. The benefits are (in no particular ...
Panther's user avatar
  • 102k
15 votes
Accepted

Cannot change Intel turbo boost (/sys/devices/system/cpu/intel_pstate/no_turbo/ not accessible)

The turbo enabled or disabled flag can be misleading. Excerpt from Documentation/cpu-freq/intel-pstate.txtin the source tree: Sysfs will show : max_perf_pct:100, which corresponds to 1 core ...
Doug Smythies's user avatar
13 votes

Bash script to verify if a process is running is not working

You asked pgrep to exactly (-x) search for a process called fail2ban but the output of systemctl status shows it is called /usr/bin/python3 instead. To check whether a systemd unit is running use ...
PerlDuck's user avatar
  • 13.3k
13 votes
Accepted

Ubuntu 18.04 gnome settings: how to fix "System policy prevents changes. Contact your system administrator" on 2nd user which is already an admin

I encountered the same issue. After a few days of investigation and reinstalling all the polkit and dbus software, I found that chrome-remote-desktop was at fault. I hope that helps.
Wes B.'s user avatar
  • 166
12 votes

How can I install sudo without using su?

Boot up the machine, and after the BIOS screen, hold down the left Shift key. You will then be prompted by a menu that looks something like this: If instead you get options like: You need to go to ...
Varun Chhangani's user avatar
10 votes

How is sudo safer than directly using su if the user is granted access to all commands?

Imagine you have 20 minutes to do something complex. You’re a bit hungover and you have to rush. “Let’s use su” you say. “It’ll save some time” is your reasoning. By accident you type rm -rf /* ...
dijksterhuis's user avatar
9 votes

How is sudo safer than directly using su if the user is granted access to all commands?

I want to add a bit of historical perspective to the other answers. Unfortunately, I do not have any sources ready except for my own memories of Usenet discussions and magazine articles. Some time ...
Dubu's user avatar
  • 919
9 votes
Accepted

Run Windows program in Wine as administrator

As far as Windows programs are concerned, Wine runs with Windows administrator rights by default when it is started by an user with ordinary permissions (not root permissions). Never run Wine as root ...
karel's user avatar
  • 115k
7 votes
Accepted

How to make sure that only the administrator can change passwords

You can remove the SETUID bit from passwd binary: sudo chmod u-s /usr/bin/passwd although this is not recommended. The /usr/bin/passwd binary is a SETUID executable with owner as root, so when ...
heemayl's user avatar
  • 91.8k
6 votes
Accepted

Can a standard 16.04 user ever make su commands?

If you don't mind using the command line then it is easy. For example, let's say you have the users Jane and Jim on your computer. Jane has sudo rights, and Jim has not. You are currently logged in as ...
albert j's user avatar
  • 1,453
6 votes

Prevent admins from disabling bash history

TL;DR: No. There is no way to do this that cannot be worked around extremely easily. More generally, you cannot grant someone full control of a computer system and then succeed at preventing them from ...
Eliah Kagan's user avatar
6 votes

Should I use an admin account or root account?

What you read was not for Ubuntu, but instead for another Linux distro. Ubuntu and its 'flavours' have the 'root' account pre-disabled. Every administrator's task in Ubuntu is done by a user assuming ...
K7AAY's user avatar
  • 17.2k
5 votes

I have only guest account. How do I create new account with administrative privileges?

sudo command can be used by the accounts which have administrative privileges. Guest account does not have such privileges. Thus, you can't use sudo there. Also, there is no other account except guest,...
Kulfy's user avatar
  • 17.7k
3 votes

Is it possible to update, upgrade and administer Ubuntu via the GUI and never touch a command line?

Terminal programs and GUI programs that serve the same purpose are intentionally designed to have partially overlapping functionality, but typically neither a terminal program nor its GUI counterpart ...
karel's user avatar
  • 115k
3 votes

How is sudo safer than directly using su if the user is granted access to all commands?

It has been possible to disable root login through ssh for decades. The Ubuntu way of disabling the root account and making people sudo everything is nothing more than a gimmick. Just "sudo -s" and ...
P. Goetterup's user avatar
3 votes
Accepted

Why do users created from System settings > user accounts not appear in sudoers?

You don't add a user to the /etc/sudoers file to grant him to use sudo to become root, but you just add him to the sudo and adm groups: sudo adduser USERNAME sudo sudo adduser USERNAME adm This is ...
Byte Commander's user avatar
  • 108k
3 votes

Why is it bad to log in as root?

Given a knowledgeable and careful user, I'm not sure that a right answer exists. I hadn't seen this answer, so I thought I'd chime in. What I don't like is unintentional changes of permissions on ...
Clayton's user avatar
  • 1,423
3 votes
Accepted

How to open terminal always with sudo privileges

To always open a terminal as root is not a good idea, but, hey, it is your computer and we hope you will act responsibly. Edit your .bashrc file and add sudo -i to the end. Then, anytime you launch ...
vanadium's user avatar
  • 88.1k
3 votes
Accepted

Your authentication attempt was unsuccessful (for sudoer)

Try adding the user user2 to the sudo group: usermod -a -G sudo user2 This should work, and is the default way of granting sudo privilege. The reason is that GUI admin rights is granted by polkit (...
Artur Meinild's user avatar
2 votes

user sudo permissions but not switch to root user

Read man sudoers. Once you manage to decode the Extended Backus-Naur Form (see Extended Backus-Naur form article on wikipedia), you'll see that ALL=(ALL:ALL) ALL is the least restrictive way of using ...
waltinator's user avatar
  • 36.5k
2 votes
Accepted

two admins : can one admin prevent another admin from accessing his/her data?

No. And anyone with physical access can change anything on a system. They do not even have to be an admin; they just need to be able to reboot. The only way to prevent others to see your data is ...
Rinzwind's user avatar
  • 300k
2 votes

Can't Join New Wifi?

the "Password for root" is the password for whichever account you logged in and has the admin/root permissions Let's say I have my user named Wattana Gaming and I want to install software or use sudo ...
Wattana Gaming's user avatar
2 votes

How can I access my files when I'm not logged in with my admin account (i.e. as a guest)?

The simple answer is that you can't access user files from a guest login. The guest login: cannot su or sudo cannot access /home, /boot, /snap, etc. despite the permissions on these You can create a ...
muru's user avatar
  • 198k
2 votes
Accepted

How to delete one out of two admin accounts?

The userdel command has a -f option to force delete the user, so typing userdel -f *Name* should delete it. If that does not work, edit /etc/passwd with your favorite text editor. You should find ...
ADDB's user avatar
  • 1,568
2 votes
Accepted

Are separate "admin" accounts overkill?

No. The idea behind "sudo" is traceability and accountability. You use 1 account per person per role. When you have 1 admin account used by 10 people ... ... you will never find the culprit when ...
Rinzwind's user avatar
  • 300k
2 votes

Why is it bad to log in as root?

It's a two-faced problem with more than one answer. For some reality check on the ever-same-but-oh-so-awful answers to this: desktop installations: use your own user and sudo if need be, otherwise ...
sjas's user avatar
  • 351
2 votes
Accepted

Is it possible to update, upgrade and administer Ubuntu via the GUI and never touch a command line?

Is Ubuntu like this? Can I give a Ubuntu computer to a employee who would rather die, than to have to touch a command line/shell, ever? My mother (75 years old) uses Ubuntu and never touches command ...
Rinzwind's user avatar
  • 300k
2 votes

Run Terminal Commands simultaneosly on multiple systems on the same network

Note: The question originally asked about running commands simultaneously on several machines - hence my first solution was using Tmux. This is probably not suited for 100s of machines at once. Use ...
Artur Meinild's user avatar
2 votes
Accepted

How to make unaccessible /root/ directory for other admin users?

Short answer: not possible. You only can make access to /root impossible by removing the "sudo" permissions of the other users. By definition, root can do everything. That includes accessing ...
vanadium's user avatar
  • 88.1k

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