Ubuntu服务器初始化

来自linux中国网wiki
Evan讨论 | 贡献2023年9月21日 (四) 10:50的版本 →‎故意的 ubuntu 2004 server
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳到导航 跳到搜索


故意的 ubuntu 2004 server

#好像是这个成功的 有个要的 不要在kali root ssh ubuntu 
  ➜  ~ ssh [email protected]
Please login as the user "evan" rather than the user "root".

sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
sed  -i   's/PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config
 sudo systemctl restart ssh

sed -i 's!#PermitRootLogin prohibit-password!PermitRootLogin yes!' /etc/ssh/sshd_config
 sed -i 's!#PermitRootLogin prohibit-password!PermitRootLogin yes!' /etc/ssh/sshd_config
  /etc/init.d/ssh restart 

问题就在这里了 把ssh-rsa前的del 120
root@ubuntu-2004-2:~/.ssh# cat authorized_keys 
no-port-forwarding,no-agent-forwarding,no-X11-forwarding,command="echo 'Please login as the user \"evan\" rather than the user \"root\".';echo;sleep 10;exit 142" ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDTR3R8Bx1+koK8bJzoYMpGU1S8DTDnptWqrTCOMhrVlQH0I9ll/3ZAcD53JdzRXVLe1NqE6q5iTFO+HY5qxWfM0+gerJQlb1e5cb1+lUFhRVglpwYlxNSVXaJFeiCLswcnGcmqR1RnGAGhcf7ncslz/BLuxFndgLqhU04zj9ISJWYh+36vttqg9tP6a40MhmeWVPOuIGNlDDVVUyjxIepn83xr0PJyILLXTBH+OiQppO1bljguig67twUBsh/FW1Wdvuw33PjkgXmKLDVaKS2S0CtC9dPOrp0afS/fsKrIu16o/VtfSrNrTmsTCmE95Ug25yOS+WuVaU19Gauez2mj lx

systemctl restart sshd
systemctl restart ssh


Enable SSH root login on Ubuntu 20.04 Focal Fossa Linux