“Ubuntu服务器初始化”的版本间的差异

来自linux中国网wiki
跳到导航 跳到搜索
(创建页面,内容为“ =故意的 ubuntu 2004 server= <pre> #好像是这个成功的 有个要的 不要在kali root ssh ubuntu ➜ ~ ssh [email protected] Please login as the use…”)
 
 
(未显示同一用户的4个中间版本)
第16行: 第16行:
 
   /etc/init.d/ssh restart  
 
   /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
  
 +
</pre>
  
  
</pre>
+
[https://linuxconfig.org/allow-ssh-root-login-on-ubuntu-20-04-focal-fossa-linux Enable SSH root login on Ubuntu 20.04 Focal Fossa Linux]
 +
[[category:devops]]

2023年9月21日 (四) 10:50的最新版本


故意的 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