diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/conf_mode/bcast_relay.py | 4 | ||||
-rwxr-xr-x | src/conf_mode/dns_forwarding.py | 2 | ||||
-rwxr-xr-x | src/conf_mode/mdns_repeater.py | 4 | ||||
-rwxr-xr-x | src/conf_mode/ntp.py | 2 | ||||
-rwxr-xr-x | src/conf_mode/ssh.py | 10 |
5 files changed, 13 insertions, 9 deletions
diff --git a/src/conf_mode/bcast_relay.py b/src/conf_mode/bcast_relay.py index 785690d9c..95f6215b5 100755 --- a/src/conf_mode/bcast_relay.py +++ b/src/conf_mode/bcast_relay.py @@ -19,7 +19,6 @@ import sys import os import fnmatch -import time import subprocess from vyos.config import Config @@ -69,8 +68,7 @@ def verify(relays): return None def generate(relays): - config_header = '### Autogenerated by {0} on {tm} ###\n'.format(os.path.basename(__file__), - tm=time.strftime("%a, %d %b %Y %H:%M:%S", time.localtime())) + config_header = '### Autogenerated by bcast_relay.py ###\n' config_dir = os.path.dirname(config_file) config_filename = os.path.basename(config_file) diff --git a/src/conf_mode/dns_forwarding.py b/src/conf_mode/dns_forwarding.py index be48cde60..77e406dcc 100755 --- a/src/conf_mode/dns_forwarding.py +++ b/src/conf_mode/dns_forwarding.py @@ -31,7 +31,7 @@ config_file = r'/etc/powerdns/recursor.conf' # especially in the semicolon-separated lists of name servers. # Please be careful if you edit the template. config_tmpl = """ -### Autogenerated by vyos-config-dns-forwarding.py ### +### Autogenerated by dns_forwarding.py ### # Non-configurable defaults daemon=yes diff --git a/src/conf_mode/mdns_repeater.py b/src/conf_mode/mdns_repeater.py index e648fd64f..474a6a5cf 100755 --- a/src/conf_mode/mdns_repeater.py +++ b/src/conf_mode/mdns_repeater.py @@ -18,8 +18,8 @@ import sys import os + import netifaces -import time from vyos.config import Config from vyos import ConfigError @@ -59,7 +59,7 @@ def verify(mdns): return None def generate(mdns): - config_header = '### Autogenerated by vyos-update-mdns-repeater.py on {tm} ###\n'.format(tm=time.strftime("%a, %d %b %Y %H:%M:%S", time.localtime())) + config_header = '### Autogenerated by mdns_repeater.py ###\n' if len(mdns) > 0: config_args = 'DAEMON_ARGS="' + ' '.join(str(e) for e in mdns) + '"\n' else: diff --git a/src/conf_mode/ntp.py b/src/conf_mode/ntp.py index 8be12e44e..9a4846bdf 100755 --- a/src/conf_mode/ntp.py +++ b/src/conf_mode/ntp.py @@ -29,7 +29,7 @@ config_file = r'/etc/ntp.conf' # Please be careful if you edit the template. config_tmpl = """ -### Autogenerated by vyos-config-ntp.py ### +### Autogenerated by ntp.py ### # # Non-configurable defaults diff --git a/src/conf_mode/ssh.py b/src/conf_mode/ssh.py index a4857bba9..7071a6ab4 100755 --- a/src/conf_mode/ssh.py +++ b/src/conf_mode/ssh.py @@ -29,7 +29,7 @@ config_file = r'/etc/ssh/sshd_config' # Please be careful if you edit the template. config_tmpl = """ -### Autogenerated by vyos-config-ssh.py ### +### Autogenerated by ssh.py ### # Non-configurable defaults Protocol 2 @@ -59,7 +59,6 @@ Banner /etc/issue.net Subsystem sftp /usr/lib/openssh/sftp-server UsePAM yes HostKey /etc/ssh/ssh_host_key -PermitRootLogin no # Specifies whether sshd should look up the remote host name, # and to check that the resolved host name for the remote IP @@ -73,6 +72,9 @@ Port {{ port }} # Gives the verbosity level that is used when logging messages from sshd LogLevel {{ log_level }} +# Specifies whether root can log in using ssh +PermitRootLogin {{ allow_root }} + # Specifies whether password authentication is allowed PasswordAuthentication {{ password_authentication }} @@ -140,6 +142,7 @@ DenyGroups {{ deny_groups | join(" ") }} default_config_data = { 'port' : '22', 'log_level': 'INFO', + 'allow_root': 'no', 'password_authentication': 'yes', 'host_validation': 'yes' } @@ -168,6 +171,9 @@ def get_config(): deny_groups = conf.return_values('access-control deny group') ssh.setdefault('deny_groups', deny_groups) + if conf.exists('allow-root'): + ssh['allow-root'] = 'yes' + if conf.exists('ciphers'): ciphers = conf.return_values('ciphers') ssh.setdefault('ciphers', ciphers) |