一.安装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服务
本文详细介绍SSH服务器的安装步骤,包括使用sudo权限安装openssh-server和openssh-client,通过ifconfig命令查找本地IP地址,验证ssh服务是否安装成功,以及如何配置sshd_config文件以允许root登录并设置加密算法。
2445

被折叠的 条评论
为什么被折叠?



