kali开启ssh服务并开机自启动

前言

网上的教程不太统一,之前没注意,直到今天才发现有些网上讲方法是错的,所以记录一下正确的方法

1.修改配置文件

(1)修改ssh_config

vim /etc/ssh/ssh_config

将 PubkeyAuthentication yes 前面的#去掉

在这里插入图片描述

(2)修改sshd_config

vim /etc/ssh/sshd_config

去掉#PermitRootLogin prohibit-password前面的#
并且将后面的prohibit-password改为yes
将 PubkeyAuthentication yes 前面的#去掉
在这里插入图片描述

重启ssh服务

service ssh restart

ssh服务开机自启动

systemctl restart ssh

猜你喜欢

转载自blog.csdn.net/weixin_57048716/article/details/129325861