Install openssh and ssh-copy-id
brew install
Create SSH Key
cd ~/.ssh/
ssh-keygen -t rsa
Copy to your server
ssh-copy-id [-p port] username@hostname
then enter your server' password
Configure
vim ~/.ssh/config
Host alias-name
HostName hostname
Port post
User username
IdentitiesOnly yes
Set alias command
vim .zshrc
alias sshl='cat ~/.ssh/config | grep "Host "'
Finish
You can list the ssh servers by `sshl`
then connect your server by `ssh alias-name`
Enjoy yourself!
FROM : virzz.com | Author:Virink
- 左青龙
- 微信扫一扫
- 右白虎
- 微信扫一扫
评论