How to enable root permissions in centos7

下次还敢
Release: 2024-04-07 20:03:24
Original
612 people have browsed it

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:
su root
Copy after login
  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 theexitcommand to exit with root privileges.

Permanently enable root permissions

  1. Edit/etc/ssh/sshd_configFile:
vi /etc/ssh/sshd_config
Copy after login
  1. Find the following line:
PermitRootLogin no
Copy after login
  1. Changenotoyes.
  2. Save and close the file.
  3. Restart the SSH service:
systemctl restart sshd
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!