Home  >  Article  >  Operation and Maintenance  >  How to enable root permissions in centos7

How to enable root permissions in centos7

下次还敢
下次还敢Original
2024-04-07 20:03:24700browse

CentOS 7 disables root permissions by default. You can enable it by following the following steps: Temporarily enable it: Enter "su root" in the terminal and enter the root password. Permanently enabled: Edit "/etc/ssh/sshd_config", change "PermitRootLogin no" to "yes", and restart the SSH service.

How to enable root permissions in centos7

How to enable Root permissions in CentOS 7

CentOS 7 disables root permissions by default for security reasons. If you need to temporarily or permanently enable root privileges, you can use the following steps:

Temporarily enable root privileges

  1. Enter the following command in the terminal:
<code>su root</code>
  1. Enter the root password.
  2. When completed, you will have root privileges and the command prompt will change to #.
  3. After completing the task, use the exit command to exit with root privileges.

Permanently enable root permissions

  1. Edit/etc/ssh/sshd_config File:
<code>vi /etc/ssh/sshd_config</code>
  1. Find the following line:
<code>PermitRootLogin no</code>
  1. Change no to yes.
  2. Save and close the file.
  3. Restart the SSH service:
<code>systemctl restart sshd</code>

You can now connect to the system via SSH using the root username and password. NOTE: For security reasons, it is highly recommended that you enable root privileges only when needed, and that root privileges should be disabled when completed.

The above is the detailed content of How to enable root permissions in centos7. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn