Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 使用libssh连接到SUSE_C++_Linux_Authentication_Suse_Libssh - Fatal编程技术网

C++ 使用libssh连接到SUSE

C++ 使用libssh连接到SUSE,c++,linux,authentication,suse,libssh,C++,Linux,Authentication,Suse,Libssh,我正在尝试使用libssh()与安装了SUSE Enterprise操作系统的计算机建立连接 ssh_options_set(tempSshSession, SSH_OPTIONS_HOST, host2Connect); ssh_options_set(tempSshSession, SSH_OPTIONS_LOG_VERBOSITY, &verbosity); ssh_options_set(tempSshSession, SSH_OPTIONS_PORT,

我正在尝试使用libssh()与安装了SUSE Enterprise操作系统的计算机建立连接

    ssh_options_set(tempSshSession, SSH_OPTIONS_HOST, host2Connect);
    ssh_options_set(tempSshSession, SSH_OPTIONS_LOG_VERBOSITY, &verbosity);
    ssh_options_set(tempSshSession, SSH_OPTIONS_PORT, &port);

    int rc = ssh_connect(tempSshSession);
    if(rc != SSH_OK) {
        printf("Error connecting to the localhost\n");
        exit(-1);
    }
    // Authorized by the password.
    rc = ssh_userauth_password(tempSshSession, username, password);
调用ssh\u userauth\u password()后,它返回响应:ssh\u AUTH\u被拒绝:身份验证失败:使用其他方法

它适用于Ubuntu、Linux Generic和CentOS等操作系统


谢谢

检查
/etc/ssh/sshd\u config
。您应该在那里的某个地方找到
permitrotlogin-forced-command
。将其设置为
yes
,您的问题就会消失。请记住,人们决定不允许每个默认根用户/密码登录是有原因的

检查
/etc/ssh/sshd\u config
。您应该在那里的某个地方找到
permitrotlogin-forced-command
。将其设置为
yes
,您的问题就会消失。请记住,人们决定不允许每个默认根用户/密码登录是有原因的

对这个问题投否决票是很有诱惑力的。我只反对恶意和严重过失。我对你的怀疑是有好处的。但是,请抓紧,其他人不会这么做。用户名
root
?如果它在其他系统上工作,那么它似乎是一个sshd配置错误(或至少是差异)。你能检查一下配置吗?你能在没有程序的情况下建立联系吗?是的,这是…@xyious from PuTTY it works这是一个很有诱惑力的问题。我只反对恶意和严重过失。我对你的怀疑是有好处的。但是,请抓紧,其他人不会这么做。用户名
root
?如果它在其他系统上工作,那么它似乎是一个sshd配置错误(或至少是差异)。你能检查一下配置吗?你能在没有程序的情况下建立连接吗?是的,它是…@xyious from PuTTY it work在我测试过它的所有其他服务器上,我还使用root作为用户这些配置设置与我测试过的所有其他服务器上的分发和管理员不同,我还使用root作为用户。这些配置设置不同于发行版和管理员之间的配置