【发布时间】:2016-11-30 07:36:12
【问题描述】:
我正在尝试使用 ssh_connect 和 libssh 进行连接,但出现以下错误。我不知道这意味着什么。有什么想法吗?
[2014/09/30 00:53:00.015877, 2] channel_open: Creating a channel 43 with 64000 window and 32768 max packet
[2014/09/30 00:53:00.050776, 1] ssh_packet_unimplemented: Received SSH_MSG_UNIMPLEMENTED (sequence number 3)
[2014/09/30 00:54:59.949316, 1] ssh_socket_exception_callback: Socket exception callback: 1 (0)
[2014/09/30 00:54:59.949483, 1] ssh_socket_exception_callback: Socket error: disconnected
Error allocating SFTP session: Socket error: disconnected
这是代码
** Initialises SSH Session **/
ssh_session initialise_ssh(char* host, int port) {
ssh_session my_ssh_session;
int verbosity = SSH_LOG_PROTOCOL;
my_ssh_session = ssh_new();
ssh_options_set(my_ssh_session, SSH_OPTIONS_HOST, host);
ssh_options_set(my_ssh_session, SSH_OPTIONS_LOG_VERBOSITY, &verbosity);
ssh_options_set(my_ssh_session, SSH_OPTIONS_PORT, &port);
rc = ssh_connect(current_session);
if (rc != SSH_OK)
{
fprintf(stderr, "Error connecting host: %s\n",
ssh_get_error(current_session));
return my_ssh_session;
}
【问题讨论】:
标签: c networking ssh