基于MacOS系统Sonoma 14.5的SSH服务禁止密码登录

基于系统Sonoma 14.5,不同系统有所差异。

  1. 修改sshd_config文件

    sudo vim /etc/ssh/sshd_config
    
  2. 找到以下两行取消注释,修改值为 no

    PasswordAuthentication no
    KbdInteractiveAuthentication no
    
  3. 重启sshd服务

    # 关闭服务
    sudo launchctl unload -w /System/Library/LaunchDaemons/ssh.plist
    # 启动服务
    sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist 
    

相关推荐

  1. 基于MacOS系统Sonoma 14.5SSH服务禁止密码登录

    2024-07-14 10:54:03       24 阅读
  2. 如何使用ssh key免密码登录服务器?

    2024-07-14 10:54:03       49 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-14 10:54:03       67 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-14 10:54:03       71 阅读
  3. 在Django里面运行非项目文件

    2024-07-14 10:54:03       58 阅读
  4. Python语言-面向对象

    2024-07-14 10:54:03       69 阅读

热门阅读

  1. 【Druid 未授权访问漏洞】解决办法

    2024-07-14 10:54:03       23 阅读
  2. 电子版pdf格式标书怎么加盖公章?

    2024-07-14 10:54:03       28 阅读
  3. not enough information C#

    2024-07-14 10:54:03       21 阅读
  4. python 网络爬虫

    2024-07-14 10:54:03       24 阅读
  5. Writing Bazel rules: simple binary rule

    2024-07-14 10:54:03       18 阅读
  6. UVA12342 Tax Calculator 题解

    2024-07-14 10:54:03       23 阅读