一.安装ssh-server
- sudo su
- apt-get install openssh-server
- apt-get install openssh-client
- ifconfig #查看本机IP地址
二.确认ssh是否安装成功
- sudo service ssh start #启动ssh
- ps -e | grep ssh
三.配置sshd_config
- vi /etc/ssh/ssd_config
- 底行模式下搜索PermitRootLogin prohibit-password,注释该行(PS:允许root登录,但是禁止root用密码登录,明显需要注释)
- 新一行添加PermitRootLogin yes
- 并在文本的最下方复制粘贴以下内容
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
-
保存,修改成功
-
sudo /etc/init.d/ssh restart #重启ssh服务