SSH 免密码登录配置

Your aim

  • To automate deploy v2ray to nodes
  • Perform commands from Web TTY
  • Call ssh from a script without entering any passwords

How to do it

First log in on host Poseidon-master as user root and generate a pair of authentication keys.
1
[email protected]:~> ssh-keygen -t rsa -N '' -f ~/.ssh/id_rsa <<< n > /dev/null
2
[email protected]:~> ssh-copy-id -i ~/.ssh/id_rsa your-v2ray-node-host
3
[email protected]'s password:
Copied!
Now you can log into your-v2ray-node-host as root from poseidon-master-server as a without password:
1
[email protected]:~> ssh your-v2ray-node-host
Copied!
复制链接