Warning: DOMDocument::loadHTML(): Tag footer invalid in Entity, line: 169 в simple_table_of_contents_generate_table_of_contents() (рядок 108 із /var/www/vhosts/kth/observer/ar25.org/observer/www/sites/all/modules/contrib/simple_table_of_contents/simple_table_of_contents.module).
If you have ever used used Ubuntu, you know that the root account is disabled. This is because the root password is not set in Ubuntu, you can assign one and use it as with every other Linux distribution. That anyway is another story. On normal Ubuntu Linux computers you need to use sudo to act as root.
I like using sudo. The first thing I do when I install a new Linux is to use visudo to edit the sudoers file. And I always give my account root rights, then I can run commands as root without switching users.
The two best advantages about using sudo command are:
Restricted privileges
Logs of the actions taken by users
I'm sure you are now fully aware of the advantages of using sudo command in a daily basis, how to use it?
In order to use sudo you first need to configure the sudoers file. The sudoers file is located at /etc/sudoers. And you should not edit it directly, you need to use the visudo command.
Once you enter sudo visudo command, you will see something like this:
# This file MUST be edited with the 'visudo' command as root.
# Please consider adding local content in /etc/sudoers.d/ instead of directly modifying this file.
# See the man page for details on how to write a sudoers file.
Defaults env_reset
Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"
# Host alias specification
# User alias specification
User_Alias GROUPONE = tech
# Cmnd alias specification
GROUPONE ALL = NOPASSWD: /home/tech/Programs/bash
# User privilege specification
root ALL=(ALL:ALL) ALL
# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
# See sudoers(5) for more information on "#include" directives:
#includedir /etc/sudoers.d
root ALL=(ALL) ALL
This line means: The root user can execute from ALL terminals, acting as ALL (any) users, and run ALL (any) command.
The first part is the user, the second is the terminal from where the user can use sudo command, the third part is which users he may act as, and the last one, is which commands he may run when using sudo.
operator ALL= /sbin/poweroff
The above command, makes the user operator can from any terminal, run the command power off.
You can also create aliases for: users -> User_Alias, run commands as other users -> Runas_Alias, host -> Host_Alias and command -> Cmnd_Alias
As you can see the alias OPERATORS includes the users joe, mike and jude, the alias OP includes the users root and operator, alias OFNET includes the network 10.1.2.0 (all the C class), and the command alias PRINTING includes the commands lpc and lprm.
So, a typical sudoers file may look like this:
User_Alias OPERATORS = joe, mike, jude
Runas_Alias OP = root, operator
Host_Alias OFNET = 10.1.2.0/255.255.255.0
Cmnd_Alias PRINTING = /usr/sbin/lpc, /usr/bin/lprm
OPERATORS ALL=ALL
#The users in the OPERATORS group can run any command from
any terminal.
linus ALL=(OP) ALL
# The user linus can run any command from any terminal as any
user in the OP group (root or operator).
user2 OFNET=(ALL) ALL
# user user2 may run any command from any machine in the
OFNET network, as any user.
user3 ALL= PRINTING
# user user3 may run lpc and lprm from any machine.
go2linux ALL=(ALL) ALL
# user go2linux may run any command from any machine acting
as any user. (like Ubuntu)
If you want not to be asked for a password use this form:
go2linux ALL=(ALL) NOPASSWD: ALL
You may want to read sudoers man page
Considering that you are still reading here a bonus:
visudo command uses vi as the editor here some tips to use it:
Switch to root, (su root), then run visudo, (as above).
Find where it says "root ALL=(ALL) ALL".
Type "o" to insert a new line below it.
Now type what you want to insert, eg "username ALL=(ALL) ALL".
Hit esc to exit insert-mode.
Type ":x" to save and exit.
Can I change the default visudo editor?
Yes, changing the default visudo editor is easy.
And just because of your dedication, and still reading until here, I'll show you how to set nano or vim to use with visudo command as default editor.
Метою «церкви програмістів» Aryan Softwerk є колективне досягнення Царства божого шляхом розробки софту для самоорганізації шляхетних духовних демосів – арійських церков. Розробка церковного софту –...
Take Control of your Linux
If you have ever used used Ubuntu, you know that the root account is disabled. This is because the root password is not set in Ubuntu, you can assign one and use it as with every other Linux distribution. That anyway is another story. On normal Ubuntu Linux computers you need to use
sudo
to act as root.sudoers.png
I like using
sudo
. The first thing I do when I install a new Linux is to usevisudo
to edit the sudoers file. And I always give my account root rights, then I can run commands as root without switching users.The two best advantages about using
sudo
command are:I'm sure you are now fully aware of the advantages of using
sudo
command in a daily basis, how to use it?In order to use
sudo
you first need to configure the sudoers file. The sudoers file is located at/etc/sudoers
. And you should not edit it directly, you need to use thevisudo
command.Once you enter sudo
visudo
command, you will see something like this:# This file MUST be edited with the 'visudo' command as root.
# Please consider adding local content in /etc/sudoers.d/ instead of directly modifying this file.
# See the man page for details on how to write a sudoers file.
Defaults env_reset
Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"
# Host alias specification
# User alias specification
User_Alias GROUPONE = tech
# Cmnd alias specification
GROUPONE ALL = NOPASSWD: /home/tech/Programs/bash
# User privilege specification
root ALL=(ALL:ALL) ALL
# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
# See sudoers(5) for more information on "#include" directives:
#includedir /etc/sudoers.d
This line means: The root user can execute from ALL terminals, acting as ALL (any) users, and run ALL (any) command.
The first part is the user, the second is the terminal from where the user can use
sudo
command, the third part is which users he may act as, and the last one, is which commands he may run when usingsudo
.The above command, makes the user operator can from any terminal, run the command power off.
You can also create aliases for: users -> User_Alias, run commands as other users -> Runas_Alias, host -> Host_Alias and command -> Cmnd_Alias
As you can see the alias OPERATORS includes the users joe, mike and jude, the alias OP includes the users root and operator, alias OFNET includes the network 10.1.2.0 (all the C class), and the command alias PRINTING includes the commands lpc and lprm.
So, a typical sudoers file may look like this:
If you want not to be asked for a password use this form:
You may want to read sudoers man page
Considering that you are still reading here a bonus:
visudo
command usesvi
as the editor here some tips to use it:Can I change the default
visudo
editor?Yes, changing the default
visudo
editor is easy.And just because of your dedication, and still reading until here, I'll show you how to set
nano
orvim
to use withvisudo
command as default editor.Using vim with visudo
Using nano with visudo
Вивчаємо Лінукс англійською.
Зверніть увагу
Стартап Aryan Softwerk запрошує ІТ-фахівців спільноти Народний Оглядач до освоєння ринку самоорганізації арійських церков