Update server.py
Browse files
server.py
CHANGED
|
@@ -107,8 +107,8 @@ def ssh():
|
|
| 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 |
-
|
| 111 |
-
|
| 112 |
os.system("/etc/init.d/ssh restart")
|
| 113 |
os.system("echo 'root:qilan' | sudo chpasswd")
|
| 114 |
os.system("echo 'PermitRootLogin yes' | sudo tee -a /etc/ssh/sshd_config")
|
|
|
|
| 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 |
+
subprocess.run(config_server_cmd, check=True, shell=True)
|
| 111 |
+
subprocess.run("systemctl restart ssh", check=True, shell=True)
|
| 112 |
os.system("/etc/init.d/ssh restart")
|
| 113 |
os.system("echo 'root:qilan' | sudo chpasswd")
|
| 114 |
os.system("echo 'PermitRootLogin yes' | sudo tee -a /etc/ssh/sshd_config")
|