大家好,我正在尝试在windows应用程序(我编写的一个程序)和ssh服务器之间建立一个简单的ssh连接。在我的代码中,我使用了libssh,并且出现了类似这样的错误: crypt_set_algorithms2:没有为3des-cbc找到加密算法函数
我使用的代码是:
#include <libssh/libssh.h>
#include <stdlib.h>
#include <stdio.h>
int main()
{
ssh_session my_ssh_session;
int rc;
int port = 22;
我正在尝试制作一个c++程序,它将连接到ssh服务器(我的笔记本电脑)。服务器没问题,因为我可以通过putty连接。虽然我写的程序到目前为止还不能。在我的代码中,我使用的是libssh.h库,在开发中我使用了visual studio 2015。我得到的错误是:crypt_set_algorithms2:没有为3des-cbc找到密码算法函数,到目前为止我还没有找到任何东西,所以我希望能对您有所帮助。我使用的代码:
#include <libssh/libssh.h>
#include <stdlib.h>
#include <stdio.h>
int m
我有两个有专用局域网IP的数字海洋实例,第一个是10.130.30.82,第二个是10.130.35.154。我可以从第一页第二页,但不是SSH。我使用ssh-copy-id将我的密钥复制到两个服务器,并且没有在第二台服务器上更改sshd_config。我的本地机器和两台服务器都是ubuntu,
SSH从第一个输入到第二个就会出现以下错误:
/etc/ssh/ssh_config: line 11: Bad configuration option: hostkey
/etc/ssh/ssh_config: line 12: Bad configuration option: hostkey
我使用libssh来实现两个系统之间的连接,ssh服务器是redhat,客户端是CentOS。
我的代码编译和链接都很好,除了在运行时我一直看到这样的情况,
[1] libssh 0.5.5 (c) 2003-2010 Aris Adamantiadis (aris@0xbadc0de.be) Distributed under the LGPL, please refer to COPYING file for information about your rights, using threading threads_noop
[2] Nonblocking connection sock
我正在尝试在我笔记本的Windows10上的SSH客户端和安装在VMWare上的Ubuntu之间建立一个简单的ssh连接。我使用libssh支持ssh,使用Qt Creator作为IDE。下面是这段代码: int verbosity = SSH_LOG_PROTOCOL;
int port = 22;
ssh_session ssh = ssh_new();
if (ssh == nullptr)
{
QMessageBox::critical(this, "Error", "Something went wrong with allocation!"
Case 1: SSH主机有一个网络接口
📷
主机SSH的路由表:
[SSH] $ ip route
default via 192.168.211.1 dev eth0
192.168.211.0/24 dev eth0 proto kernel scope link src 192.168.211.119
从SSH_Client启动ssh连接到LAN_0上的主机SSH可以流畅地工作:
[SSH_CLIENT] $ ssh user@192.168.211.119 -p 22
Case 2: SSH主机有两个网络接口
📷
主机SSH的路由表:
[SSH] $ ip route
default
我的本地机器上有libssh2.so.1.0.1(.so)二进制文件,但我的机器上没有任何头文件。
这是我一直试图通过ssh协议连接到我的服务器的基本ssh程序。参考:
现在我无法将库(libssh2.so.1.0.1)链接到下面的示例程序。
下面是我编写的带有错误的示例程序。
sshsample.cpp:
#include <stdlib.h>
#include <stdio.h>
int main()
{
ssh_session my_ssh_session;
int rc;
int port = 22;
int verbosity
我正在尝试将我生成的密钥添加到ssh代理。下面是我的步骤
C:\repo>ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (C:\Users\mante1/.ssh/id_rsa):C:\repo\key
生成密钥后,我将启动ssh代理并添加它
C:\repo>start-ssh-agent
Found ssh-agent at 13460
Found ssh-agent socket at /tmp/ssh-vKzdrs37QYVK/agent.821
我正在尝试使用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.9
我用systemctl disable ssh禁用ssh服务器,然后重新启动。重新启动后,我仍然可以通过ssh登录到远程服务器。我使用systemctl status ssh来检查服务器状态,并且它是不活动的。
$ systemctl -a | grep ssh
ssh.service loaded inactive dead OpenBSD Secure Shell server
ssh@3-192.168.0.120:22-192.168.0.104:31079.service
因此,我基本上是试图覆盖我的ssh命令,所以我只需键入ssh,默认情况下它将连接到我的主服务器。然后,如果我给它传递一个参数,比如说username@server_port,它将运行基本命令。
# Fast SSH (a working progress) TODO: make work without naming the function `fssh`
function fssh() {
ALEX_SERVER_CONNECTION=$ALEX_SERVER_UNAME@$ALEX_SERVER_PORT
# if the `ssh` argument is not