zoukankan      html  css  js  c++  java
  • 禁止root直接登陆linux系统

    直接修改文件

    # vim /etc/ssh/sshd_config

    SyslogFacility AUTHPRIV
    PermitRootLogin no
    RSAAuthentication yes
    PubkeyAuthentication yes
    AuthorizedKeysFile	.ssh/authorized_keys
    PasswordAuthentication no
    ChallengeResponseAuthentication no
    GSSAPIAuthentication yes
    GSSAPICleanupCredentials yes
    UsePAM yes
    X11Forwarding yes
    Subsystem	sftp	/usr/libexec/openssh/sftp-server
    /etc/init.d/sshd restart

      如何免密码切换到root呢?

    vim   /etc/sudoers

    【普通账号】 ALL=(ALL) NOPASSWD: ALL

    保存之后,回到普通用户直接输入sudo -s即可免密切换到root账号

  • 相关阅读:
    [国家集训队] Crash 的文明世界
    [国家集训队] middle
    [正睿集训2021] 构造专练
    [正睿集训2021] LIS
    CF482E ELCA
    UVA
    UVA
    UVA
    UVA
    UVA
  • 原文地址:https://www.cnblogs.com/bixiaoyu/p/9190963.html
Copyright © 2011-2022 走看看