我正在尝试使用libssh(https://www.libssh.org/)与安装了SUSE企业操作系统的计算机建立连接。
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_userauth_password()调用之后,它返回响应:"SSH_AUTH_DENIED:身份验证失败:使用其他方法“
它适用于像: Ubuntu、Linux和CentOS这样的操作系统。
谢谢
发布于 2017-09-14 14:15:34
检查/etc/ssh/sshd_config。你应该在那里找到PermitRootLogin forced-command-only。将其设置为yes,您的问题就会消失。请记住,有一个原因,为什么人们已经决定不允许每个默认的根用户/传递登录。
https://stackoverflow.com/questions/46219725
复制相似问题