Skip to content

Instantly share code, notes, and snippets.

@wangxianhe
Last active September 13, 2018 02:31
Show Gist options
  • Save wangxianhe/d9bb9a4006bc0ec456c0ddb62d69a1a8 to your computer and use it in GitHub Desktop.
Save wangxianhe/d9bb9a4006bc0ec456c0ddb62d69a1a8 to your computer and use it in GitHub Desktop.
CentOS7 ssh免密码访问
操作比较简单,不详细说了,参考下面命令:
HOME=/home/wxh #对应用户账号家目录,此处以/home/wxh为例
ssh-keygen -t dsa -N "" -f "$HOME/.ssh/id_dsa"
cp -r $HOME/.ssh/id_dsa.pub $HOME/.ssh/authorized_keys
echo "StrictHostKeyChecking no" >> $HOME/.ssh/config
chmod 600 $HOME/.ssh/config
chmod 600 $HOME/.ssh/authorized_keys
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment