def _update_ssh_setting(sshd_config, name, value):
 with watch(sshd_config) as config_file:
  with shell_env():
   sed(sshd_config, ('^(\\s*#\\s*)?%s\\s+(yes|no)' % name), ('%s %s' % (name, value)), use_sudo=True)
   _append(sshd_config, ('%s %s' % (name, value)), use_sudo=True)
 if (config_file.changed and is_running('ssh')):
  restart('ssh')

def _update_ssh_setting ( sshd_config , name , value ) : with watch ( sshd_config ) as config_file : with shell_env ( ) : sed ( sshd_config , ( '^(\\s*#\\s*)?%s\\s+(yes|no)' % name ) , ( '%s %s' % ( name , value ) ) , use_sudo = True ) _append ( sshd_config , ( '%s %s' % ( name , value ) ) , use_sudo = True ) if ( config_file . changed and is_running ( 'ssh' ) ) : restart ( 'ssh' )
update a yes/no setting in the ssh config file .