[小技巧] mac禁止ssh用密码登录-只能用key

date
Mar 14, 2023
slug
tip-mac-only-ssh-by-key
status
Published
summary
小技巧
tags
tip
type
Post
URL

Problem & Summary

    Solution

      sudo sed -I .bak 's/#PasswordAuthentication yes/PasswordAuthentication no/g' /etc/ssh/sshd_config
      sudo launchctl stop com.openssh.sshd && sudo launchctl start com.openssh.sshd

      Screenshots

       

      © Ying Bun 2021 - 2024