@task
def configure_ssh():
    """
    Change sshd_config defaults:
    Change default port
    Disable root login
    Disable password login
    Restrict to only login group
    """
    ssh_config = u'/etc/ssh/sshd_config'
    files.sed(ssh_config, u"Port 22$", env.ssh_port % u"Port %s", use_sudo=True)
    files.sed(ssh_config, u"PermitRootLogin yes", u"PermitRootLogin no", use_sudo=True)
    files.append(ssh_config, u"AllowGroups login", use_sudo=True)
    files.append(ssh_config, u"PasswordAuthentication no", use_sudo=True)
    service_command(u'ssh', u'reload')
dataset/ETHPy150Open python/raspberryio/fabfile.py/configure_ssh/swapped operands of `%`