Fix wo secure --sshport
This commit is contained in:
@@ -13,6 +13,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
- WordOps is now installed from PyPI using pip [WordOps](https://pypi.org/project/wordops/)
|
||||
- New Nginx package built with OpenSSL 1.1.1d and updated brotli module
|
||||
|
||||
#### Fixed
|
||||
|
||||
- `wo stack upgrade` when using nginx-ee
|
||||
- `wo secure --auth`
|
||||
- `wo secure --sshport` not working with default ssh config
|
||||
|
||||
### v3.9.9.2 - 2019-10-04
|
||||
|
||||
#### Added
|
||||
|
||||
@@ -69,7 +69,7 @@ class WOSecureController(CementBaseController):
|
||||
WOGit.add(self, ["/etc/nginx"],
|
||||
msg="Add Nginx to into Git")
|
||||
pargs = self.app.pargs
|
||||
passwd = RANDOM.gen(self)
|
||||
passwd = RANDOM.long(self)
|
||||
if not pargs.user_input:
|
||||
username = input("Provide HTTP authentication user "
|
||||
"name [{0}] :".format(WOVar.wo_user))
|
||||
@@ -220,9 +220,14 @@ class WOSecureController(CementBaseController):
|
||||
Log.info(self, "Please Enter valid port number :")
|
||||
port = input("Server SSH port [22]:")
|
||||
pargs.user_input = port
|
||||
WOShellExec.cmd_exec(self, "sed -i \"s/Port.*/Port "
|
||||
"{port}/\" /etc/ssh/sshd_config"
|
||||
.format(port=pargs.user_input))
|
||||
if WOFileUtils.grepcheck(self, '/etc/ssh/sshd_config', '#Port'):
|
||||
WOShellExec.cmd_exec(self, "sed -i \"s/#Port.*/Port "
|
||||
"{port}/\" /etc/ssh/sshd_config"
|
||||
.format(port=pargs.user_input))
|
||||
else:
|
||||
WOShellExec.cmd_exec(self, "sed -i \"s/Port.*/Port "
|
||||
"{port}/\" /etc/ssh/sshd_config"
|
||||
.format(port=pargs.user_input))
|
||||
# allow new ssh port if ufw is enabled
|
||||
if os.path.isfile('/etc/ufw/ufw.conf'):
|
||||
# add rule for proftpd with UFW
|
||||
|
||||
@@ -5,7 +5,13 @@ import string
|
||||
class RANDOM:
|
||||
"""Random strings generator"""
|
||||
|
||||
def gen(self):
|
||||
def long(self):
|
||||
long_random = ''.join([random.choice
|
||||
(string.ascii_letters + string.digits)
|
||||
for n in range(24)])
|
||||
return long_random
|
||||
|
||||
def short(self):
|
||||
short_random = ''.join([random.choice
|
||||
(string.ascii_letters + string.digits)
|
||||
for n in range(24)])
|
||||
|
||||
Reference in New Issue
Block a user