Qilan2 commited on
Commit
e7bd77f
·
verified ·
1 Parent(s): 57aaefd

Update server.py

Browse files
Files changed (1) hide show
  1. server.py +2 -1
server.py CHANGED
@@ -103,8 +103,9 @@ def ssh():
103
  subprocess.run("apt update", check=True, shell=True)
104
  subprocess.run("apt install openssh-server -y", check=True, shell=True)
105
  subprocess.run("apt-get install vim -y", check=True, shell=True)
 
106
  config_client_cmd = "sudo sed -i '/PasswordAuthentication/s/^#//g' /etc/ssh/ssh_config"
107
- run_command(config_client_cmd)
108
  config_server_cmd = "sudo sed -i '/PermitRootLogin prohibit-password/s/prohibit-password/yes/' /etc/ssh/sshd_config"
109
  run_command(config_server_cmd)
110
  run_command("systemctl restart ssh")
 
103
  subprocess.run("apt update", check=True, shell=True)
104
  subprocess.run("apt install openssh-server -y", check=True, shell=True)
105
  subprocess.run("apt-get install vim -y", check=True, shell=True)
106
+
107
  config_client_cmd = "sudo sed -i '/PasswordAuthentication/s/^#//g' /etc/ssh/ssh_config"
108
+ subprocess.run(config_client_cmd, check=True, shell=True)
109
  config_server_cmd = "sudo sed -i '/PermitRootLogin prohibit-password/s/prohibit-password/yes/' /etc/ssh/sshd_config"
110
  run_command(config_server_cmd)
111
  run_command("systemctl restart ssh")