ubuntu安装ssh服务
#sudo apt-get update
#sudo apt install openssh-server
ubuntu启动SSH服务
#sudo /etc/init.d/ssh start
关闭SSH服务
3sudo /etc/init.d/ssh stop
重启SSH服务
#sudo /etc/init.d/ssh restart
查看sshd进程是否启动
#ps -e | grep sshd
Ubuntu Server下ssh启动失败
解决方法:
- 查看/etc/ssh/sshd_config的文件是否有错使用下面的命令
#sudo /usr/sbin/sshd -t - 如果错误是Bad SSH2 mac spec,则键入命令:ssh -Q mac查看支持的mac,然后重新编辑sshd_config中的相应行
Ciphers 3des-cbc,aes128-cbc,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com - 如果错误是Bad SSH2 cipher spec,则键入命令:ssh -Q cipher查看支持的cipher,然后重新编辑sshd_config中的相应行
MACs hmac-sha1,hmac-sha1-96,hmac-sha2-256,hmac-sha2-512,hmac-md5,hmac-md5-96,umac-64@openssh.com,umac-128@openssh.com,hmac-sha1-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-md5-etm@openssh.com,hmac-md5-96-etm@openssh.com,umac-64-etm@openssh.com,umac-128-etm@openssh.com
ubuntu下配置ssh遇到ssh_host_rsa_key和ssh_host_dsa_key无法加载解决办法
解决方法:
1、新建ssh_host_dsa_key文件
#ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key
此命令会让用户输入passphrase建立key,可以输入自己密码或回车。
2、新建ssh_host_rsa_key文件
#ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key
此命令会让用户输入passphrase建立key,可以输入自己密码或回车 。
3、重启ssh
service ssh restart
本文详细介绍了在Ubuntu系统中安装SSH服务的过程,包括更新软件包列表、安装openssh-server、启动、关闭及重启SSH服务的方法。同时,针对SSH服务启动失败、ssh_host_rsa_key和ssh_host_dsa_key无法加载等问题提供了具体解决方案。
4325

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



