网页设计论文致谢,云优客seo排名公司,实际缴纳多少,青岛贸易公司 网站制作Failed to restart sshd.service: Unit sshd.service not found.出现这个问题以及远程链接mobaxterm出现 Network error: Connection refused的解决方案如下
其实出现问题二就是kail2018里面的ssh服务未开启#xff0c;和问题一是同样的#xff0c;故汇集写在一篇帖子中和问题一是同样的故汇集写在一篇帖子中希望对广大学者有所启发。
首先第一步直接ping主机是可以ping通的说明网络此时是正常的
rootkali:~# ping 10.32.6.117
PING 10.32.6.117 (10.32.6.117) 56(84) bytes of data.
64 bytes from 10.32.6.117: icmp_seq1 ttl64 time0.025 ms
64 bytes from 10.32.6.117: icmp_seq2 ttl64 time0.072 ms
64 bytes from 10.32.6.117: icmp_seq3 ttl64 time0.072 ms第二步检查sshd的安装情况以下界面表面已安装
rootkali:~# ps -e | grep ssh1421 ? 00:00:00 ssh-agent
第三步ss -ntl 查询22端口是否开启此处没有22端口
rootkali:~# ss -ntl
State Recv-Q Send-Q Local Address:Port Peer Address:Port 此时我们需要修变量执行vim /etc/ssh/sshd_config, 显示没有被修改如果没被修改加入PermitRootLogin yes在第三步中需要修改的环境变量图片细节如下 这里我们可以按 i 键插入文字按 Esc 键退出编辑按 :wq 保存编辑内容
第四步重启sshd服务我这里失败了所以接下来继续执行命令
到这里如果问题已经解决的小伙伴可以去查看一下端口号确定无误可以连接。
rootkali:~# sudo service sshd restart
Failed to restart sshd.service: Unit sshd.service not found.第五步执行重启命令
rootkali:~# systemctl enable ssh.service
Synchronizing state of ssh.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable ssh
Created symlink /etc/systemd/system/sshd.service → /lib/systemd/system/ssh.service.第六步以及第七步查看端口号
rootkali:~# service sshd start
rootkali:~# ss -ntl
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 128 0.0.0.0:22 0.0.0.0:*
LISTEN 0 128 [::]:22 [::]:* 文章就写到这里如果有误欢迎批评指正