root login - usuario @ usuario: / home $ sudo -i root @ r00t: ~ # Voila, sou root e nao tenho senha root, certo? [fechadas]

0

Eu estou querendo saber sobre a conta root que está sendo desativada no Ubuntu e se faz alguma diferença para a segurança. Se alguém invadir seu PC, ele poderá digitar:

user@user:/home$ sudo -i
root@r00t:~# Voila, i am root and I don't have root password, right?

Esse é um exemplo do meu PC, por que exatamente desativá-lo? Por muitos anos eu não tive dúvidas sobre o disabled root, mas agora eu tenho isso em minha mente cada vez mais ...

Se alguém já invadiu sua conta / PC através de IP ou, no entanto, qual é a diferença se o root está desabilitado / habilitado se eles tiverem que digitar sudo -i para obter root?

Aqui está uma citação de um post aqui:

In Linux there is a special account called root. By default it is locked in Ubuntu but you can enable the root account.

This is normally not a good idea however and you should consider very carefully before enabling the root login.

There are several good reasons not to log in as root but to use sudo instead including

  • Users don't have to remember an extra password (i.e. the root password), which they are likely to forget (or write down so anyone can crack into their account easily).
  • It avoids the "I can do anything" interactive login by default (e.g. the tendency by users to login as an "Administrator" user in Microsoft Windows systems), you will be prompted for a password before major changes can happen, which should make you think about the consequences of what you are doing.
  • sudo adds a log entry of the command(s) run (in /var/log/auth.log). If you mess up, you can always go back and see what commands were run. It is also nice for auditing.
  • Every cracker trying to brute-force their way into your box will know it has an account named Root and will try that first. What they don't know is what the usernames of your other users are. Since the Root account password is locked, this attack becomes essentially meaningless, since there is no password to crack or guess in the first place.
  • Allows easy transfer for admin rights, in a short term or long term period, by adding and removing users from groups, while not compromising the Root account. sudo can be setup with a much more fine-grained security policy.

This is discussed in more detail in the RootSudo Comunity Documentation

If you have a number of commands which would normally require sudo you can type sudo -i before the first command then exit after the last to avoid repeatedly typing sudo. To run a GUI application with root priviledges press ALT+F2 and enter gksu or gksudo followed by the name of your program (unless you are using the KDE desktop in which case the command is kdesu)

For example gksu nautilus runs the file manager with root privileges.

As you can see it is almost never necessary to enable the root login. That said to enable the root login all that is required is to set a root password

 sudo passwd root

and set a password. You will then be able to login as root but for all the reasons I have given above and more I would not recommend you do it.

    
por Nani Klener 22.09.2016 / 09:54

1 resposta

7

Em primeiro lugar, o exemplo do seu PC é um exemplo falso, porque o nome do host não muda quando você faz sudo -i , obviamente. Aqui está um exemplo real:

zanna@monster:~$ sudo -i
[sudo] password for zanna:
root@monster:~#

(digitei minha própria senha de usuário). Agora, como eu realmente não preciso desse shell de root para fazer nada, a primeira coisa que vou fazer é exit it.

O principal ponto de desabilitar o login root é evitar o comportamento imprudente dos usuários. Não há razão para usar privilégios de root, a menos que você realmente precise: fazer o login como root o tempo todo reduz a segurança do sistema para um sistema Windows sujeito a malware e vírus.

Se alguém com intenção mal-intencionada conseguir obter a senha de um usuário com privilégio sudo , você terá tantos problemas quanto teria se tivesse a senha de root. A decisão do design do Ubuntu em desabilitar o login raiz não faz diferença para isso.

    
por Zanna 22.09.2016 / 10:36