openssh安装与使用

openssh安装

  • 执行命令安装:apt install openssh-server

查看ssh状态

  • 使用命令:/etc/init.d/ssh status查看

启动、关闭、重启

/etc/init.d/ssh restart #重启
/etc/init.d/ssh start #启动
/etc/init.d/ssh stop #关闭

允许root用户登陆

  • 修改/etc/ssh/sshd_config文件,找到(如果找到的PermitRootLogin已被注释的就取消其注释)
# Authentication:
LoginGraceTime 120
PermitRootLogin without passwd (或者是PermitRootLogin prohibit-password)
StrictModes yes

修改为

# Authentication:
LoginGraceTime 120
PermitRootLogin yes
StrictModes yes
  • 然后重启ssh

设置ssh开机自启

  • 开机自启:
update-rc.d ssh enable
  • 关闭开机自启:
update-rc.d ssh disabled
  • 以上命令需要重启机器后生效

kali清华大学镜像源

deb http://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling main contrib non-free

转载于:https://www.jianshu.com/p/9c684bc1e535

猜你喜欢

转载自blog.csdn.net/weixin_33910137/article/details/91158115