ubuntu1604使用之旅——启动ssh系列
---恢复内容开始---
1、安装ssh的client和server:
sudo apt-get install openssh-server openssh-client
2、然后就要安装key:
ssh-keygen -t rsa -f ssh_host_rsa_key -N ""
ssh-keygen -t dsa -f ssh_host_dsa_key -N ""
ssh-keygen -t ecdsa -f ssh_host_ecdsa_key -N ""
ssh-keygen -t ed25519 -f ssh_host_ed25519_key -N ""
3、把安装好的key放到/etc/ssh/下面:
sudo mv ssh_host_* /etc/ssh/
4、修改权限:
chmod 700 /etc/ssh/ssh_host_*
5、打开ssh配置文件:
sudo vim /etc/ssh/sshd_config
文末添加以下内容:
Ciphers aes128-cbc,aes192-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr,3des-cbc,arcfour128,arcfour256,arcfour,blowfish-cbc,cast128-cbc
MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-sha1-96,hmac-md5-96
KexAlgorithms diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group1-sha1,curve25519-sha256@libssh.org
保存退出
6、重启ssh服务:
sudo /etc/init.d/ssh restart
7、然后就可以愉快的玩耍ssh啦!
---恢复内容结束---