def METHOD_NAME(config_dir):
    hostkey = '{}/hostkey'.format(config_dir)
    connkey = '{}/connkey'.format(config_dir)
    os.system('ssh-keygen -b 2048 -t rsa -q -N "" -f {}'.format(hostkey))
    os.system('ssh-keygen -b 2048 -t rsa -q -N "" -f {}'.format(connkey))
    port = _find_free_port(22222)
    server_config_str = SSHD_CONFIG.format(port=port, hostkey=hostkey,
                                           connpubkey='{}.pub'.format(connkey),
                                           sftp_path=_get_system_sftp_path())
    server_config = '{}/sshd_config'.format(config_dir)
    with open(server_config, 'w') as f:
        f.write(server_config_str)
    return server_config, connkey, port