Fix changing ssh port

This commit is contained in:
VirtuBox
2019-09-24 02:47:06 +02:00
parent d048ebadf8
commit d512542b4a

View File

@@ -218,8 +218,8 @@ class WOSecureController(CementBaseController):
break
sshport = (ssh_line).split(' ')
current_ssh_port = (sshport[1]).strip()
WOShellExec.cmd_exec(self, "sed -i \"s/Port {current}/Port "
"{port}\" /etc/ssh/sshd_config"
WOShellExec.cmd_exec(self, "sed -i \"s/Port.*/Port "
"{port}/\" /etc/ssh/sshd_config"
.format(current=current_ssh_port,
port=pargs.user_input))
WOGit.add(self, ["/etc/ssh"],