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

来自linux中国网wiki
跳到导航 跳到搜索
第16行: 第16行:
 
   /etc/init.d/ssh restart  
 
   /etc/init.d/ssh restart  
  
 
+
问题就在这里了 把ssh-rsa前的del
 +
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
  
  

2023年7月5日 (三) 11:33的版本


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




Enable SSH root login on Ubuntu 20.04 Focal Fossa Linux