K
K
Konstantin Luntovsky2019-07-29 12:49:52
linux
Konstantin Luntovsky, 2019-07-29 12:49:52

Why is it not recommended to always use the root account in linux?

Why is it not recommended to always use the root account in linux.
I don’t know about you, but the first thing I do if I connect to the server not as root, I drive in sudo -i.
There are people who automatically drive in sudo before each command.
Etc.
So why invent unnecessary difficulties for yourself, all the same, you do all the manipulations under the root.

Answer the question

In order to leave comments, you need to log in

7 answer(s)
A
Adamos, 2019-07-29
@Adamos

"Mom, look, I'm driving without hands!
Mom, look, I'm driving without a tooth!"
That's about why. The risk of screwing up is higher, while 90% of what you do after entering sudo does not actually require superuser rights.
Plus, all files created by root are owned by root, which is often not what you had in mind. Instead of shamanism with chmod / chown, it's easier to log in under the user who will work with them.
Actually, the recommendation "do not work as root" means "do not confuse work with administration, root is only for the second."

C
CityCat4, 2019-07-29
@CityCat4

Is it true that this issue is considered on the toaster from all possible sides and points of view? :)
When you understand why working under root is dangerous, you can safely work under it. This recommendation is usually given to novice admins and it is completely justified. Especially with the current fashion, it's stupid to copy-paste everything that gets into your console.

A
Artem @Jump, 2019-07-29
Tag

Why is it not recommended to always use the root account in linux.
Because this entry is for system administration.
Running as root is like running with an Administrator account in Windows.

S
Serezha, 2019-07-29
Ahen @Ahen

Short-term connections to a remote server for its administration are not the same as working under Linux.

M
moropsk, 2019-07-29
@moropsk

Sudo is not needed when working in the server console. Is it so?
https://serveradmin.ru/sudo-ne-nuzhen-pri-workote-v...

V
Victor Taran, 2019-07-29
@shambler81

without access to critical files you can't.
1. get infected with a virus (you can’t do it at all)
2. Damage it
3. OS itself provides confidentiality, you just got used to Windows, it’s generally normal not to work from the admin.
After thinking about this, you will come to the conclusion that this is much more logical than working from root.
However, I always work on servers from root, because I have enough knowledge and experience and understanding of what I do and how I do it in full, and I understand the risks.

M
MisterSpock, 2019-07-30
@MisterSpock

I try to stay away from sudo unless it's about installing software. There was a sad experience at the dawn of a career, with other people's scripts. Actually, both in Windows and in Linux - you need to work only as a user, and save sudo and root for special cases.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question