libssh2编译问题 [问题点数:20分]

Bbs1
本版专家分:0
结帖率 75%
libssh2的ubuntu下编译so
在ubuntu16.04下<em>编译</em>的<em>libssh</em><em>2</em>的so文件,可以正常调用
windows vc++ libssh2编译
我要用到<em>libssh</em><em>2</em>的库 但是搜寻了很久都没有正确的通过<em>编译</em>,求助,帮我具体说一下步骤吗 谢谢!!rn\<em>libssh</em><em>2</em>-1.4.3\src\openssl.h(40) : fatal error C1083: Cannot open include file: 'openssl/opensslconf.h': No such file or directoryrnrn
libssh2 vs2010编译的动态库
MD的Debug和Release版本,源码使用<em>libssh</em><em>2</em>-1.9.0,依赖库使用Win3<em>2</em>OpenSSL-1_1_1c,未使用zlib。
vs2017编译64位的libssh2
vs<em>2</em>017<em>编译</em>出来的,64位的<em>libssh</em><em>2</em> 库。(csdn没有0积分的选项,如果没有积分的朋友,可以留下邮箱,有空我会发。)
libssh2使用问题
大神们,最近在开发sftp客户端,多线程执行的时候遇到如下<em>问题</em>rn*** glibc detected *** /home/test/client/src/test: double free or corruption (fasttop): 0x0000<em>2</em>aaac000ef00 ***rn*** glibc detected *** /home/test/client/src/test: double free or corruption (!prev): 0x0000<em>2</em>aaac000eb10 ***rn======= Backtrace: =========rn======= Backtrace: =========rn/lib64/libc.so.6(+0x76166)[0x<em>2</em>aaaab9<em>2</em>9166]rn/lib64/libc.so.6(+0x76166)[0x<em>2</em>aaaab9<em>2</em>9166]rn/usr/lib64/libcrypto.so.10(CRYPTO_free+0x1d)[0x<em>2</em>aaaabf1cc5d]rn/usr/lib64/libcrypto.so.10(OBJ_NAME_add+0x9<em>2</em>)[0x<em>2</em>aaaabf1fcc<em>2</em>]rn/usr/lib64/libcrypto.so.10(OpenSSL_add_all_ciphers+0x3<em>2</em>7)[0x<em>2</em>aaaabfa5bf7]rn/usr/lib64/libcrypto.so.10(OPENSSL_add_all_algorithms_noconf+0xe)[0x<em>2</em>aaaabfa58be]rn/usr/local/lib/<em>libssh</em><em>2</em>.so.1(<em>libssh</em><em>2</em>_init+0x39)[0x<em>2</em>aaaaaf090b9]rn/lib64/libc.so.6(+0x78c93)[0x<em>2</em>aaaab9<em>2</em>bc93]rn/home/test/client/src/test[0x473450]rn/lib64/libc.so.6(+0x7bb60)[0x<em>2</em>aaaab9<em>2</em>eb60]rn/lib64/libc.so.6(clone+0x6d)[0x<em>2</em>aaaab99bb6d]rn======= Memory map: ========rnrnrngdb调试断错误 下面情况rnrnProgram received signal SIGABRT, Aborted.rn[Switching to Thread 0x<em>2</em>aaabc60<em>2</em>700 (LWP <em>2</em>44516)]rn0x0000<em>2</em>aaaab8e59<em>2</em>5 in raise () from /lib64/libc.so.6rn(gdb) wherern#0 0x0000<em>2</em>aaaab8e59<em>2</em>5 in raise () from /lib64/libc.so.6rn#1 0x0000<em>2</em>aaaab8e7105 in abort () from /lib64/libc.so.6rn#<em>2</em> 0x0000<em>2</em>aaaab9<em>2</em>3837 in __libc_message () from /lib64/libc.so.6rn#3 0x0000<em>2</em>aaaab9<em>2</em>9166 in malloc_printerr () from /lib64/libc.so.6rn#4 0x0000<em>2</em>aaaabf1cc5d in CRYPTO_free () from /usr/lib64/libcrypto.so.10rn#5 0x0000<em>2</em>aaaabf1fcc<em>2</em> in OBJ_NAME_add () from /usr/lib64/libcrypto.so.10rn#6 0x0000<em>2</em>aaaabfa5bf7 in OpenSSL_add_all_ciphers () from /usr/lib64/libcrypto.so.10rn#7 0x0000<em>2</em>aaaabfa58be in OPENSSL_add_all_algorithms_noconf () from /usr/lib64/libcrypto.so.10rn#8 0x0000<em>2</em>aaaaaf090b9 in <em>libssh</em><em>2</em>_init (flags=) at global.c:48rn#9 0x0000<em>2</em>aaaaaefdb4e in <em>libssh</em><em>2</em>_session_init_ex (my_alloc=, my_free=, rn my_realloc=, abstract=0x0) at session.c:500rn#10 0x000000000040557<em>2</em> in ssh<em>2</em>_t::connect (this=0x<em>2</em>aaabc5fca<em>2</em>0, ip="19<em>2</em>.168.1.177", port=100<em>2</em>1, username="test", password="test1<em>2</em>3")rn at ssh<em>2</em>.cpp:88rnrnrnrnrnrn那个大神能指点下这是为什么啊 ,急用,在线等啊
libssh2 VS下编译好的库和头文件
本资料包含内容为 <em>libssh</em><em>2</em>.lib <em>libssh</em><em>2</em>.h <em>libssh</em><em>2</em>_publickey.h <em>libssh</em><em>2</em>_sftp.h <em>libssh</em><em>2</em>_config.h 程序是在VS<em>2</em>008下<em>编译</em>产生的,可以直接在WINDOWS下使用,记得程序在调用库时,还要#pragma comment(lib,"ws<em>2</em>_3<em>2</em>.lib")
libssh2动态库
<em>libssh</em><em>2</em>动态库,含有mingw版本和VS版本,库已经<em>编译</em>好了,直接使用就可以。。。。。。。。。。。。。。。
libssh2 源码
<em>libssh</em><em>2</em>源码,<em>libssh</em><em>2</em>源码,用于学习SSH<em>2</em>
linux 编译libssh2官网例子ssh2_exec.c 报错
gcc ssh<em>2</em>_exec.c -o shh<em>2</em> -lssh<em>2</em>rn<em>编译</em>报错rnrnssh<em>2</em>.c:(.text+0x19e): undefined reference to `<em>libssh</em><em>2</em>_init'rnssh<em>2</em>.c:(.text+0x98b): undefined reference to `<em>libssh</em><em>2</em>_channel_get_exit_signal'rnssh<em>2</em>.c:(.text+0xa5f): undefined reference to `<em>libssh</em><em>2</em>_exit'rncollect<em>2</em>: ld returned 1 exit statusrnrnrn<em>libssh</em><em>2</em>那么多方法为什么单单就缺这三个。。。。
libssh2源码
从github上获取的源码,免费分享给大家,希望合理使用
libssh2编译过程
详细描述了<em>libssh</em><em>2</em>在Vs<em>2</em>008下的<em>编译</em>过程
libssh2 source code
<em>libssh</em><em>2</em> source code could be used for compile Net::SSH<em>2</em> perl package.
libssh2库的接口设计模式
C语言的项目代码的架构设计很少有书籍介绍到,今天来谈论一下一个通用的软件代码架构模型。 项目工程中有include目录和src目录。src目录中的所有文件最终会被生成一个so文件。在部署的时候将这个so文件和include目录中的所有h文件一起发布,这样,当用户程序包含了include目录中的文件后,就能使用其中的API函数了。 接着,就以<em>libssh</em><em>2</em>.h这个文件做说明。这个文件没有包含任何...
libssh2连接状态
用<em>libssh</em><em>2</em>连接远程主机rn如何得到主机的连接状态rn<em>libssh</em><em>2</em>连接成功了之后rn如果被连接的主机断网了或者改密码了或者socket断开了这个我要肿么知道rn
python 的libssh2库求教
rn想做一个scp的脚本rn(因为通用性<em>问题</em>,所以没用expect)rn用到<em>libssh</em><em>2</em>库rnrn“”“rnapt-get install <em>libssh</em><em>2</em>-1-dev zlib1g-dev python-devrncd ssh4pyrnpython setup.py buildrnpython setup.py installrn”“”rn测试代码如下rn[code=Python]rn#! /usr/bin/pythonrnimport socketrnimport <em>libssh</em><em>2</em>rnimport osrnrndef ssh<em>2</em>_scp (server_ip,server_port,usr_name,pw,local_path_name,server_path_name):rn sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)rn sock.connect((server_ip, server_port))rn session = <em>libssh</em><em>2</em>.Session()rn session.startup(sock)rn session.userauth_password(usr_name, pw)rn sourceFile = open(local_path_name, 'rb')rn #print os.stat(local_path_name).st_sizern channel = session.scp_send(server_path_name , 0644, os.stat(local_path_name).st_size)rnrn while True:rn data = sourceFile.read(4096)rn if not data:rn breakrn channel.write(data)rn channel.send_eof()rn sourceFile.close ()rn[/code]rnrn不知道为什么scp到server总是少很多字节。rnrn请问有哪位兄弟用过python的<em>libssh</em><em>2</em>库?rn指点一下,不胜感激!
libssh2库的应用
<em>libssh</em><em>2</em>库的应用
libssh2静态库及相关库
windows下<em>编译</em>好的<em>libssh</em><em>2</em>静态开发库,包括openssl和zlib库,如果要使用直接包涵相应的库我头文件就可以了
VC-Win32版本libssh2
ssh<em>2</em>的<em>编译</em>后的lib库,资源上有一个是java版的,这个是VC-Win3<em>2</em>版本 <em>libssh</em><em>2</em>.lib
libssh2 1.8.0 32位动态库
<em>libssh</em><em>2</em> 1.8.0 3<em>2</em>位动态库 1.VS<em>2</em>013 <em>编译</em> <em>2</em>.debug与release
libssh2编译成静态库
我下载的是<em>libssh</em><em>2</em>-1.<em>2</em>.9版本,里面包含了很多东西,现在想把它做成linux环境下使用的静态库。rn应该怎么做啊?最好有个步骤啥的!!!!!!!!!!
最新的libssh2库源码
Capabilities and Features Key Exchange Methods: diffie-hellman-group1-sha1, diffie-hellman-group14-sha1, diffie-hellman-group-exchange-sha1 Hostkey Types: ssh-rsa, ssh-dss Ciphers: aes<em>2</em>56-cbc (rijndael-cbc@lysator.liu.se), aes19<em>2</em>-cbc, aes1<em>2</em>8-cbc, 3des-cbc, blowfish-cbc, cast1<em>2</em>8-cbc, arcfour, none Compression Schemes: zlib, none MAC hashes: hmac-sha1, hmac-sha1-96, hmac-md5, hmac-md5-96, hmac-ripemd160 (hmac-ripemd160@openssh.com), none Authentication: none, password, public-key, hostbased, keyboard-interactive Channels: shell, exec &#40;incl. SCP wrapper&#41;, direct-tcpip, subsystem Global Requests: tcpip-forward Channel Requests: x11, pty Subsystems: sftp(version 3), publickey(version <em>2</em>) Thread-safe: just don't share handles simultaneously Non-blocking: it can be used both blocking and non-blocking Your sockets: the app hands over the socket, calls select() etc. OpenSSL or gcrypt: builds with either
libssh2静态库、动态库
Windows版的<em>libssh</em><em>2</em>静态库、动态库和包含文件,可一直在项目中使用
libssh2安装全过程
1.sudo apt-get install openssl <em>2</em>.cd /usr/src/ 3.sudo wget http://<em>libssh</em><em>2</em>.org/download/<em>libssh</em><em>2</em>-1.3.0.tar.gz 4.sudo tar zxvf <em>libssh</em><em>2</em>-1.3.0.tar.gz 5.cd <em>libssh</em><em>2</em>-1.3.0/ 6. ./configure 7.sudo make a...
libssh2下载压缩文件
使用<em>libssh</em><em>2</em>库实现从服务器下载压缩文件到本地,能实现吗?rn在<em>libssh</em><em>2</em>库中有对tar.gz这类非文本文件的操作吗?rn若有请各位大神告知,,万分感谢!!
libssh2 在win7 64位下编译好的完整库
求<em>libssh</em><em>2</em> 在win7 64位下<em>编译</em>好的完整库(头文件,lib,dll),本人<em>编译</em>了一天,装了vs <em>2</em>010 <em>2</em>008,换了<em>2</em>次系统,修改n多次源码,都<em>编译</em>不过,无语了,可能人品真的是太差,求哪位有<em>编译</em>好的完整库能给个,最好是新一点的,感激不尽!
QT mingw 使用libssh2出现的问题
rn环境是:windows7(64)+QT mingwrnrn我是C++/QT新手 请大家帮我看看,谢谢rnrn<em>libssh</em><em>2</em>参照这个帖子<em>编译</em>的:http://windrocblog.sinaapp.com/?p=888rnrnrnrn[img=https://img-bbs.csdn.net/upload/<em>2</em>01407/11/14050759<em>2</em>8_137857.png][/img]rnrnrnrn使用的时候出现<em>问题</em>:rnrnD:\qtObject\<em>libssh</em><em>2</em>-1.4.3\include\<em>libssh</em><em>2</em>.h:88: error: expected unqualified-id before string constantrn extern "C" rnrnD:\Qt\Qt5.3.1\Tools\mingw48<em>2</em>_3<em>2</em>\i686-w64-mingw3<em>2</em>\include\excpt.h:11: error: expected '' before end of linern #pragma pack(push,_CRT_PACKING)rnrnD:\Qt\Qt5.3.1\Tools\mingw48<em>2</em>_3<em>2</em>\i686-w64-mingw3<em>2</em>\include\excpt.h:-1: At global scope:rnrnD:\Qt\Qt5.3.1\Tools\mingw48<em>2</em>_3<em>2</em>\i686-w64-mingw3<em>2</em>\include\excpt.h:11: error: expected declaration before end of line
libcurl.a(with zlib, openssl , libssh2) 含release静态库和动态库, mingw32编译
附件中文件解压后可直接使用,win7 ,gcc 4.9.<em>2</em>以上<em>编译</em>。 <em>编译</em>过程中libcurl, zlib未作修改 openssl更改了test下几个文件,使用tdm-gcc 5.1.0<em>编译</em> <em>libssh</em><em>2</em>在github上下的源码,更改openssl.h文件,使用cmake<em>编译</em> libcurl使用lib下makefile.m3<em>2</em>文件<em>编译</em>。 注意:这几个库调用是一定要注意顺序,否则link会报错,具体可参照附件中的一个实例,实例采用codeblocks组织。
64位CentOS编译32位动态库(openssl libssh2 libcurl)
我的linux是64位的(x86_64),gcc是4.4.7(用file命令查看gcc是64位的),目前要<em>编译</em>三份源代码(openssl <em>libssh</em><em>2</em> libcurl),<em>编译</em>成64位是没有<em>问题</em>的。但现在需要<em>编译</em>3<em>2</em>位的库,网上说只需要加上-m3<em>2</em>就行,即:gcc -m3<em>2</em>.我自己写了一个helloworld,使用gcc -m64没有<em>问题</em>,但使用gcc -m3<em>2</em>就不行,请问是不是缺什么东西?
libssh2执行不了top命令么?
参考官网给的例子rn写了个远程执行命令的小程序rn但是不能执行top命令rnrn揪心rnrn高手指点指点
基于qt5、sftp(libssh2)下载文件
基于qt5+mingw+win7,里面包括有封装好的sftp库,参考https://download.csdn.net/download/guesswhohh/10<em>2</em>4446<em>2</em>并修改之
求助啊! libssh2的下载与使用
<em>libssh</em><em>2</em>这个开源库怎么下载啊“?? rn我找了一个网站 www.<em>libssh</em><em>2</em>.org ,但是里面下载下来的东西我不知道该怎么去安装,说明书等等什么都没有,而且网站是谁能帮帮忙 怎么加载这个 <em>libssh</em><em>2</em> 开源库rnrn分不多了,见谅啊!
libssh2 远程执行多个命令
官网给的例子可以执行一个命令rn但是在执行第二个命令时就不能执行了rn是否有高手做过这个东西rn给个指点。。
qt sftp下载,使用Libssh2
压缩包里面包括sftp的库文件,vs版本:vc9.0(vs<em>2</em>008),qt:4.8.6,qt sftp下载文件。<em>编译</em>好程序 可以传参调用。
使用libssh2实现sftp的文件上传下载
最近的工作需要将文件的上传下载从ftp修改为sftp。rn查阅了资料发现可以通过<em>libssh</em><em>2</em>库实现,但是查该库相关的资料,非常少,官方主页我现在的网络环境不能访问。rn网上有一些示例代码,但是和文件的上传下载的实现不是很清晰。大致了解需要使用<em>libssh</em><em>2</em>_sftp_write()类的库,但是不是很确定,也不知道使用方法。rn哪位大神有这个库相关库函数的说明,以及实现文件上传下载的示例代码,还望不吝赐教。
为php安装libssh2扩展
首先我是使用brew安装的:andy@AndyMacBookPro:~brewsearchssh<em>2</em><em>libssh</em><em>2</em>php53−ssh<em>2</em>php54−ssh<em>2</em>php55−ssh<em>2</em>php56−ssh<em>2</em>andy@AndyMacBookPro:  brew search ssh<em>2</em> <em>libssh</em><em>2</em> php53-ssh<em>2</em> php54-ssh<em>2</em> php55-ssh<em>2</em> php56-ssh<em>2</em>
libssh2的最新版本1.4.3,bsd的license
<em>libssh</em><em>2</em>的最新版本1.4.<em>2</em>,bsd的license
VC2008中使用LibSSH2搭建SSH2开发环境
基于SSH<em>2</em>安全协议的开发可以使用<em>libssh</em><em>2</em>库实现,这是本人<em>编译</em>好的<em>libssh</em><em>2</em>库以及在VC<em>2</em>008中搭建<em>libssh</em><em>2</em>开发环境的总结。折腾n天终于搞定,贡献出来供大家分享! *^_^*
libssh2使用再次遇到问题,球帮助呀
session = <em>libssh</em><em>2</em>_session_init();在使用此函数创建一个session的时候,运行到这里会提示rnrn应用程序无法正常启动(0xc000007b)
求:用libssh2,登录免密码服务器的代码
刚接触ssh<em>2</em>, 用secureCRT工具登录server时,只需要输入用户名,不用密码。rnrn现在,调试网上window7 下的ssh<em>2</em>客户端小程序,试试<em>libssh</em><em>2</em>动态库(已经有了)的使用。rn但遇到了<em>问题</em>,就是无法登录免密码的server。如果换需要用户名和密码的ssh<em>2</em> server,则可以登录。rnrn[color=#FF0000]请大家看看下面的代码有什么<em>问题</em>,或者给个简单的学习样例,多谢多谢。[/color]rnrn#include "<em>libssh</em><em>2</em>.h"rn rn#ifdef HAVE_WINSOCK<em>2</em>_Hrn#include rn#endifrn#ifdef HAVE_SYS_SOCKET_Hrn#include rn#endifrn#ifdef HAVE_NETINET_IN_Hrn#include rn#endifrn#ifdef HAVE_SYS_SELECT_Hrn#include rn#endifrn#ifdef HAVE_UNISTD_Hrn#include rn#endifrn#ifdef HAVE_ARPA_INET_Hrn#include rn#endifrn rn//#include rn#include rn#include rn#include rn#include rn#include rn#include rn rn#pragma comment(lib,"<em>libssh</em><em>2</em>.lib")rn#pragma comment(lib,"WS<em>2</em>_3<em>2</em>.lib")rnstatic int waitsocket(int socket_fd, LIBSSH<em>2</em>_SESSION *session)rnrn struct timeval timeout;rn int rc;rn fd_set fd;rn fd_set *writefd = NULL;rn fd_set *readfd = NULL;rn int dir;rn rn timeout.tv_sec = 10;rn timeout.tv_usec = 0;rn rn FD_ZERO(&fd);rn rn FD_SET(socket_fd, &fd);rn rn /* now make sure we wait in the correct direction */ rn dir = <em>libssh</em><em>2</em>_session_block_directions(session);rnrn rn if(dir & LIBSSH<em>2</em>_SESSION_BLOCK_INBOUND)rn readfd = &fd;rn rn if(dir & LIBSSH<em>2</em>_SESSION_BLOCK_OUTBOUND)rn writefd = &fd;rn rn rc = select(socket_fd + 1, readfd, writefd, NULL, &timeout);rn rn return rc;rnrn rnint main(int argc, char *argv[])rnrn const char *hostname = "19<em>2</em>.168.1.1";rn const char *commandline = "ls";rn const char *username = "admin";rn const char *password = "";rn unsigned long hostaddr;rn int sock;rn struct sockaddr_in sin;rn const char *fingerprint;rn LIBSSH<em>2</em>_SESSION *session;rn LIBSSH<em>2</em>_CHANNEL *channel;rn int rc;rn int exitcode;rn char *exitsignal=(char *)"none";rn int bytecount = 0;rn size_t len;rn LIBSSH<em>2</em>_KNOWNHOSTS *nh;rn int type;rn rn#ifdef WIN3<em>2</em>rn WSADATA wsadata;rn WSAStartup(MAKEWORD(<em>2</em>,0), &wsadata);rn#endifrn if (argc > 1)rn /* must be ip address only */ rn hostname = argv[1];rn rn if (argc > <em>2</em>) rn username = argv[<em>2</em>];rn rn if (argc > 3) rn password = argv[3];rn rn if (argc > 4) rn commandline = argv[4];rn rn rn rc = <em>libssh</em><em>2</em>_init (0);rnrn if (rc != 0) rn fprintf (stderr, "<em>libssh</em><em>2</em> initialization failed (%d)\n", rc);rn return 1;rn rn rn hostaddr = inet_addr(hostname);rn rn /* Ultra basic "connect to port <em>2</em><em>2</em> on localhost"rn * Your code is responsible for creating the socket establishing thern * connectionrn */ rn sock = socket(AF_INET, SOCK_STREAM, 0);rn rn sin.sin_family = AF_INET;rn sin.sin_port = htons(<em>2</em><em>2</em>);rn sin.sin_addr.s_addr = hostaddr;rn if (connect(sock, (struct sockaddr*)(&sin),rn sizeof(struct sockaddr_in)) != 0) rn fprintf(stderr, "failed to connect!\n");rn return -1;rn rn rn /* Create a session instance */ rn session = <em>libssh</em><em>2</em>_session_init();rnrn if (!session)rn return -1;rn rn /* tell <em>libssh</em><em>2</em> we want it all done non-blocking */ rn <em>libssh</em><em>2</em>_session_set_blocking(session, 0);rnrn rn /* ... start it up. This will trade welcome banners, exchange keys,rn * and setup crypto, compression, and MAC layersrn */ rn while ((rc = <em>libssh</em><em>2</em>_session_handshake(session, sock)) ==rnrn LIBSSH<em>2</em>_ERROR_EAGAIN);rn if (rc) rn fprintf(stderr, "Failure establishing SSH session: %d\n", rc);rn return -1;rn rn rn nh = <em>libssh</em><em>2</em>_knownhost_init(session);rnrn if(!nh) rn /* eeek, do cleanup here */ rn return <em>2</em>;rn rn rn /* read all hosts from here */ rn <em>libssh</em><em>2</em>_knownhost_readfile(nh, "known_hosts",rnrn LIBSSH<em>2</em>_KNOWNHOST_FILE_OPENSSH);rn rn /* store all known hosts to here */ rn <em>libssh</em><em>2</em>_knownhost_writefile(nh, "dumpfile",rnrn LIBSSH<em>2</em>_KNOWNHOST_FILE_OPENSSH);rn rn fingerprint = <em>libssh</em><em>2</em>_session_hostkey(session, &len, &type);rnrn if(fingerprint) rn struct <em>libssh</em><em>2</em>_knownhost *host;rn#if LIBSSH<em>2</em>_VERSION_NUM >= 0x010<em>2</em>06rn /* introduced in 1.<em>2</em>.6 */ rn int check = <em>libssh</em><em>2</em>_knownhost_checkp(nh, hostname, <em>2</em><em>2</em>,rnrn fingerprint, len,rn LIBSSH<em>2</em>_KNOWNHOST_TYPE_PLAIN|rn LIBSSH<em>2</em>_KNOWNHOST_KEYENC_RAW,rn &host);rn#elsern /* 1.<em>2</em>.5 or older */ rn int check = <em>libssh</em><em>2</em>_knownhost_check(nh, hostname,rnrn fingerprint, len,rn LIBSSH<em>2</em>_KNOWNHOST_TYPE_PLAIN|rn LIBSSH<em>2</em>_KNOWNHOST_KEYENC_RAW,rn &host);rn#endifrn fprintf(stderr, "Host check: %d, key: %s\n", check,rn (check key:"");rn rn /*****rn * At this point, we could verify that 'check' tells us the key isrn * fine or bail out.rn *****/ rn rn else rn /* eeek, do cleanup here */ rn return 3;rn rn <em>libssh</em><em>2</em>_knownhost_free(nh);rnrn rn if ( strlen(password) != 0 ) rn /* We could authenticate via password */ rn while ((rc = <em>libssh</em><em>2</em>_userauth_password(session, username, password)) ==rnrn LIBSSH<em>2</em>_ERROR_EAGAIN);rn if (rc) rn fprintf(stderr, "Authentication by password failed.\n");rn goto shutdown;rn rn rn else rn /* Or by public key */ rn while ((rc = <em>libssh</em><em>2</em>_userauth_publickey_fromfile(session, username,rnrn "/home/user/"rn ".ssh/id_rsa.pub",rn "/home/user/"rn ".ssh/id_rsa",rn password)) ==rn LIBSSH<em>2</em>_ERROR_EAGAIN);rn if (rc) rn fprintf(stderr, "\tAuthentication by public key failed\n");rn goto shutdown;rn rn rn rn#if 0rn <em>libssh</em><em>2</em>_trace(session, ~0 );rnrn#endifrn rn /* Exec non-blocking on the remove host */ rn while( (channel = <em>libssh</em><em>2</em>_channel_open_session(session)) == NULL &&rnrn <em>libssh</em><em>2</em>_session_last_error(session,NULL,NULL,0) ==rnrn LIBSSH<em>2</em>_ERROR_EAGAIN )rn rn waitsocket(sock, session);rn rn if( channel == NULL )rn rn fprintf(stderr,"Error\n");rn exit( 1 );rn rn while( (rc = <em>libssh</em><em>2</em>_channel_exec(channel, commandline)) ==rnrn LIBSSH<em>2</em>_ERROR_EAGAIN )rn rn waitsocket(sock, session);rn rn if( rc != 0 )rn rn fprintf(stderr,"Error\n");rn exit( 1 );rn rn for( ;; )rn rn /* loop until we block */ rn int rc;rn dorn rn char buffer[0x4000];rn rc = <em>libssh</em><em>2</em>_channel_read( channel, buffer, sizeof(buffer) );rnrn if( rc > 0 )rn rn int i;rn bytecount += rc;rn fprintf(stderr, "We read:\n");rn for( i=0; i < rc; ++i )rn fputc( buffer[i], stderr);rn fprintf(stderr, "\n");rn rn else rn if( rc != LIBSSH<em>2</em>_ERROR_EAGAIN )rn /* no need to output this for the EAGAIN case */ rn fprintf(stderr, "<em>libssh</em><em>2</em>_channel_read returned %d\n", rc);rn rn rn while( rc > 0 );rn rn /* this is due to blocking that would occur otherwise so we loop onrn this condition */ rn if( rc == LIBSSH<em>2</em>_ERROR_EAGAIN )rn rn waitsocket(sock, session);rn rn elsern break;rn rn exitcode = 1<em>2</em>7;rn while( (rc = <em>libssh</em><em>2</em>_channel_close(channel)) == LIBSSH<em>2</em>_ERROR_EAGAIN )rnrn waitsocket(sock, session);rn rn if( rc == 0 )rn rn exitcode = <em>libssh</em><em>2</em>_channel_get_exit_status( channel );rnrn <em>libssh</em><em>2</em>_channel_get_exit_signal(channel, &exitsignal,rnrn NULL, NULL, NULL, NULL, NULL);rn rn rn if (exitsignal)rn fprintf(stderr, "\nGot signal: %s\n", exitsignal);rn elsern fprintf(stderr, "\nEXIT: %d bytecount: %d\n", exitcode, bytecount);rn rn <em>libssh</em><em>2</em>_channel_free(channel);rnrn channel = NULL;rn rnshutdown:rn rn <em>libssh</em><em>2</em>_session_disconnect(session,rnrn "Normal Shutdown, Thank you for playing");rn <em>libssh</em><em>2</em>_session_free(session);rnrn rn#ifdef WIN3<em>2</em>rn closesocket(sock);rn#elsern close(sock);rn#endifrn fprintf(stderr, "all done\n");rn rn <em>libssh</em><em>2</em>_exit();rnrn rn return 0;rnrn
windows平台上采用libssh2开发的SSH
使用<em>libssh</em><em>2</em>开发的一个SSH,终于写好了,分享给大家。
怎么往VC中导入libssh2库?
小弟新手,想用ssh<em>2</em>实现windows远程连接linux,有人说需要<em>libssh</em><em>2</em>库,我在网上下了一些,都是linux版的,<em>libssh</em><em>2</em>库有windows版的吗?如果我下载到了一个windows版的<em>libssh</em><em>2</em>库,怎样才能导入我的VC?谢谢了,特别是最后一个怎么导入的<em>问题</em>,小弟之前都是原装VC就开始用啊,现在要导入<em>libssh</em><em>2</em>小弟还不知道是怎么回事。
新手请问下关于SSH库(libssh,libssh2)的问题
项目需求,想请问下C++实现利用SSH协议传输数据的<em>问题</em>。rnrn客户端和服务器端均为windows,现在需要在项目中添加利用SSH传输数据的功能,大概查了一下,用的比较多的库是<em>libssh</em>,<em>libssh</em><em>2</em>,openssh等以及其它的一些,能否请问一下,当下比较常用的是哪种,针对windows需要注意什么,windows服务器端如何开启SSH服务,C++实现的代码强度如何?rnrn新手一名,有什么小白言论勿怪。请有经验的朋友指教一下,或是给些参考资料,或简单代码,比较详尽的话可以追加分数。
DLL Debug - DLL OpenSSL - DLL LibSSH2
压缩包中包含相应库和头文件。版本7.55.1。放心下载 压缩包中包含相应库和头文件。版本7.55.1。放心下载
关于windows下使用LibSSH2向Linux发送多条指令的问题?
最近一个项目需要在Windows下让Linux执行几条命令,命令不是固定的,可由用户输入,遇到点<em>问题</em>,请做过的朋友帮帮忙。rnrn执行一条指令可以用<em>libssh</em><em>2</em>_channel_exec我知道,但是只能执行一条指令,如果几条指令有联系好像<em>libssh</em><em>2</em>_channel_exec就不符合要求了,比如说先执行 cd /root ,然后 lsrnrn执行多条指令要用<em>libssh</em><em>2</em>_channel_shell对不对?用<em>libssh</em><em>2</em>_channel_shell之后每条指令加上"\n"使用<em>libssh</em><em>2</em>_channel_write发送,然后因该怎么读写我没法理出头绪,在没让输入的时候输入是没有用的,但是我没法知道什么时候可以输入。在网上有人(英文)很模糊的说要用<em>libssh</em><em>2</em>_poll,我参照ssh<em>2</em>_echo.c的例子写了下面的一个函数:rn[code=C/C++]rnint GetResult<em>2</em>(LIBSSH<em>2</em>_CHANNEL *channel, char *szBuff, int nLen, int nTimeout=<em>2</em>000)rnrn ZeroMemory(szBuff, nLen);rn LIBSSH<em>2</em>_POLLFD fds;rn ZeroMemory(&fds, sizeof(LIBSSH<em>2</em>_POLLFD));rn fds.type = LIBSSH<em>2</em>_POLLFD_CHANNEL;rn fds.fd.channel = channel;rn fds.events = LIBSSH<em>2</em>_POLLFD_POLLIN | LIBSSH<em>2</em>_POLLFD_POLLOUT;rn int nRead = 0;rn for(int i=0;i
菜鸟才学c++,使用libssh2的时候遇到一个问题
使用nuget安装了<em>libssh</em><em>2</em>,在使用<em>libssh</em><em>2</em>_session_init时出现了这个错误,求教大佬该怎么改?rn我本来是想自己<em>编译</em>lib,但是网上使用nmake -f的时候失败了(<em>编译</em>的是win3<em>2</em>下的makefile.watcom,之前<em>编译</em>zlib的时候是用的makefile.msc)rn严重性 代码 说明 项目 文件 行 禁止显示状态rn错误 LNK<em>2</em>019 无法解析的外部符号 <em>libssh</em><em>2</em>_session_init_ex,该符号在函数 main 中被引用 test C:\Users\80661\Documents\Visual Studio <em>2</em>015\Projects\test\test\main.obj 1 rn这种情况该怎么办啊
SSH2协议 libssh2库 windows+vc++6.0环境下开发环境搭建
1 SSH<em>2</em>协议 <em>libssh</em><em>2</em>库 windows+vc++6.0环境下开发环境搭建 <em>2</em> vc6环境全部通过测试 不存在vc6调用VS<em>2</em>005及以上版本生成LIB的连接报错的<em>问题</em> 3 安装步骤和操作参考网上,类似http://blog.chinaunix.net/uid-<em>2</em>0479991-id-<em>2</em>16<em>2</em>69.html
关于libssh2,登陆失败Authentication by password failed
主机升级ssh后,原来好使的项目就不能正常使用了,报错“Response exception,,Authentication by password failed”,但是实际情况不是密码<em>问题</em>,调试正常输出用户名和密码都是正常的,但是在主机上直接ssh user@x.x.x.x 就能成功。rnrn失败的syslogrnFeb 11 18:<em>2</em>8:51 jfapp1 sshd[19843]: SSH: Server;Ltype: Version;Remote: 133.<em>2</em><em>2</em>4.<em>2</em>18.33-51415;Protocol: <em>2</em>.0;Client: <em>libssh</em><em>2</em>_1.8.0rnFeb 11 18:<em>2</em>8:51 jfapp1 sshd[19843]: SSH: Server;Ltype: Kex;Remote: 133.<em>2</em><em>2</em>4.<em>2</em>18.33-51415;Enc: aes1<em>2</em>8-ctr;MAC: hmac-sha<em>2</em>-<em>2</em>56;Comp: none [preauth]rnFeb 11 18:<em>2</em>8:51 jfapp1 sshd[19843]: SSH: Server;Ltype: Authname;Remote: 133.<em>2</em><em>2</em>4.<em>2</em>18.33-51415;Name: drecv1 [preauth]rnrn成功的syslogrnFeb 11 18:<em>2</em>9:46 jfapp1 sshd[<em>2</em>5964]: SSH: Server;Ltype: Version;Remote: 133.<em>2</em><em>2</em>4.<em>2</em>18.35-53441;Protocol: <em>2</em>.0;Client: OpenSSH_7.3p1+sftpfilecontrol-v1.3-hpn14v11rnFeb 11 18:<em>2</em>9:46 jfapp1 sshd[<em>2</em>5964]: SSH: Server;Ltype: Kex;Remote: 133.<em>2</em><em>2</em>4.<em>2</em>18.35-53441;Enc: chacha<em>2</em>0-poly1305@openssh.com;MAC: ;Comp: none [preauth]rnFeb 11 18:<em>2</em>9:46 jfapp1 sshd[<em>2</em>5964]: SSH: Server;Ltype: Authname;Remote: 133.<em>2</em><em>2</em>4.<em>2</em>18.35-53441;Name: drecv1 [preauth]rnAccepted keyboard-interactive/pam for drecv1 from 133.<em>2</em><em>2</em>4.<em>2</em>18.35 port 53441 ssh<em>2</em>rnrn之前正常使用的版本:rn[/opt/openssl/lib/hpux64]$ssh -VrnOpenSSH_6.<em>2</em>p1+sftpfilecontrol-v1.3-hpn13v1<em>2</em>, OpenSSL 0.9.8o 01 Jun <em>2</em>010rnHP-UX Secure Shell-A.06.<em>2</em>0.006, HP-UX Secure Shell versionrn升级后不能正常使用的版本:rn[/drecvdata/drecv1]$ssh -VrnOpenSSH_7.3p1+sftpfilecontrol-v1.3-hpn14v11, OpenSSL 1.0.<em>2</em>k <em>2</em>6 Jan <em>2</em>017rnHP-UX Secure Shell-A.07.30.003, HP-UX Secure Shell version
QT - 使用libssh2连接远程服务器,进行读写操作
主要有两个类,代码如下:Ssh<em>2</em>头文件#ifndef SSH<em>2</em>_H #define SSH<em>2</em>_H #include &quot;Channel.h&quot; #include &amp;lt;<em>libssh</em><em>2</em>.h&amp;gt; #ifdef WIN3<em>2</em> #pragma comment(lib,&quot;Ws<em>2</em>_3<em>2</em>.lib&quot;) #endif class Ssh<em>2</em> { public: Ssh<em>2</em>(const string &amp;amp...
编译问题编译
XmlDocument doc=new XmlDocument();rn XmlNode node;rn XmlElement rootNode;rn string sSelect;rn rn doc.Load("E:\\PROGRAME\\practise\\aspnet\\default\\uselist.xml");rn rootNode=doc.DocumentElement;rn sSelect="descendant::user[id'"+sId+"']";rn node=rootNode.SelectSingleNode(sSelect);rn中sSelect="descendant::user[id'"+sId+"']";为什么老说我有<em>问题</em><em>编译</em>不通过?
linux 下编译libssh2库文件执行make时报错 ,求大神解决?
报错内容:rncc1: error: unrecognized command line option "-std=gnu90"rn![图片说明](https://img-ask.csdn.net/upload/<em>2</em>01908/08/1565<em>2</em>54577_<em>2</em>6<em>2</em><em>2</em>30.png)
文件编译与工程编译问题
如下代码段 我用的是DEV C++ 如果作为一个文件<em>编译</em>会产生Link错误,但是作为一个工程<em>编译</em>会通过<em>编译</em>。rn请问各位,这是为什么啊?rnrn[code=C/C++]rn#include rnrnusing namespace std;rnrnclass Optrrnrn public:rn rn Optr(int val=0):value(val)rn Optr(const Optr &ref):value(ref.value)rn rn Optr& operator ++ ();rn Optr operator ++ (int);rn rn void print() cout<
急,急,编译编译问题
我的环境是tomcat5.5;jdk1.5版本的,tomcat5.5运行jsp不带数据库成功,于是我编写了一个简单的servlet的可就是不成功,有17个错误,提示非法字符,可我用的是ansi编码呀,怎么错了,用uft-8也不行呀,急,急请指教~,请问是不是还需要servlet组件,还是缺少什么??哪里错了|??rnimport java.io.IOException;rnimport java.io.PrintWriter;rnimport javax.servlet.*;rnimport java.util.*;rnimport javax.servlet.ServletException;rnimport javax.servlet.http.HttpServlet;rnimport javax.servlet.http.HttpServletRequest;rnimport javax.servlet.http.HttpServletResponse;rn  public class ab extends HttpServlet rnrn  protected void doGet(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException rn  rnrn  PrintWriter out=response.getWriter();rn  out.println(" This is a servlet test.");rn  out.flush();rn  rn  rn
关于EJB编译问题?(带的编译问题)
package com.eocsh.HelloStateless;rnimport javax.ejb.*;rnimport java.rmi.RemoteException;rnrnpublic interface HelloStatelessHome extends EJBHomern HelloStateless create() throws RemoteException,CreateException;rn rnrnrnpackage com.eocsh.HelloStateless;rnrnimport javax.ejb.*;rnimport java.rmi.RemoteException;rnpublic class HelloStatelessBean implements SessionBeanrnrn rn public void ejbCreate(int emplNum)rn rn public void ejbRemove()rn rn public void ejbPassivate()rn rn public void ejbActivate()rn rn public void setSessionContext(SessionContext sa)rn rnrnrnpackage com.eocsh.HelloStateless;rnrnimport javax.ejb.*;rnimport java.rmi.RemoteException;rnrnpublic interface HelloStateless extends EJBObjectrn String getUserName() throws RemoteException;rnrnrn在我<em>编译</em>HelloStatelessHome.java 时候 会有错误出现找不到HelloStateless rnrn如何<em>编译</em>才能通过,还有如何才能运行?
编译问题
最近在调试HTTPS的过程中遇到一些<em>编译</em>错误,这里整理记录一下。 1.  relocation truncated to fit : R_MIPS_16 against / unreference declaration of XXX  初步判断是有类型未声明或者定义。按照提示寻找XXX 找到以后发现, XXX的定义和声明都是存在的。 然后就否定了这个想法,开始怀疑<em>编译</em>器的<em>问题</em>,在网上查发现
编译问题
[code=C/C++]rn#includern#includernvoid pt()rnrnprintf("%d\n",1<em>2</em>3);rnrnrnvoid main()rnrnprintf("%d\n",456);rnrn[/code]rnrn以上代码中,主函数没有调用pt()函数,也没有使用math库函数,<em>编译</em>完后的可执行文件是否包含pt()函数和math库函数的汇编代码?还是只包含pt()函数的汇编代码?
编译问题
增加的pbl,如何增量<em>编译</em>,成为pbd?原来的那个“应用.pbl”是不是也需要重新<em>编译</em>一下?
编译问题
error C<em>2</em>440: 'default argument' : cannot convert from 'const char [1]' to 'LPCTSTR'rn1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style castrnrnrn怎么解决啊??
编译问题
我在<em>编译</em>的时候,无论是<em>编译</em>成P代码还是机器代码,运行时都提醒需要pbvm70.dll文件,这个库是必需的吗,需要和应用程序一起发布吗?rn 各位高手能否给我讲一讲<em>编译</em>的过程,什么情况下必须写pbr文件?
编译问题!~~~
别人写的程序,怎么传过来就不行了rn提示错误:rnfatal error C1083: Cannot open source file: 'C:\Documents and Settings\tanwei\Program Files\Microsoft Visual Studio\VC98\MFC\SRC\APPMODUL.CPP': No such file or directoryrnrn这是什么原因啊?
编译问题
软件包 packname.tar.gzrn使用 gunzip packname.tar.gz 先拆解为 packname.tarrn再使用 tar packname.tar 拆解为 packnamern我找到该软件包下的 Makefile 文件rn使用 make -f Makefilern<em>编译</em>完成后我怎么运行该程序rn另外rn在Linux 下程序文件的扩展名是什么rn我看书说unix 下是name.orn不知道对不?rn向大家请教???rn
编译问题?
如何使我<em>编译</em>出的可执行程序最小?(delphi7.0)
编译问题
我的单片机上有1个3<em>2</em>M的ROM,一个64K的RAM,程序当然是写入ROM中,可数据(局部变量或全局变量)应该是放在RAM中,<em>编译</em>器怎么知道我的RAM的地址范围呢,
编译问题
ild: (undefined symbol) inet_addr -- referenced in the text segment of comm.ornild: (undefined symbol) inet_ntoa -- referenced in the text segment of info.ornild: (undefined symbol) gethostbyname -- referenced in the text segment of cftp.rnornild: (undefined symbol) gethostbyname -- referenced in the text segment of info.rnornrn找不到socket函数,估计是环境变量的设置,不知道要加什么,请大家帮忙指点一下。
编译问题
<em>编译</em>的时候选择“增量<em>编译</em>”或者“完全<em>编译</em>”的时候有个别的pbl不能<em>编译</em>成新的pbd文件,我没有办法,只有把没有<em>编译</em>的pbl找出来,单独<em>编译</em>。那位高手有过类似的痛苦经历?有什么好的办法?
非常漂亮的精美系统后台模板5下载
非常漂亮的精美系统后台模板5非常漂亮的精美系统后台模板5 相关下载链接:[url=//download.csdn.net/download/z650816/2548206?utm_source=bbsseo]//download.csdn.net/download/z650816/2548206?utm_source=bbsseo[/url]
最好的远程工具下载
最好的远程工具 相关下载链接:[url=//download.csdn.net/download/pcvv2012/4842245?utm_source=bbsseo]//download.csdn.net/download/pcvv2012/4842245?utm_source=bbsseo[/url]
uc1698驱动下载
uc1698驱动,STM32的芯片,有需要的朋友可以移植到其他平台 相关下载链接:[url=//download.csdn.net/download/zheguzai000/7699681?utm_source=bbsseo]//download.csdn.net/download/zheguzai000/7699681?utm_source=bbsseo[/url]
相关热词 c# login 居中 c# 考试软件 c# 自然语言分析 c# 分段读取文件 c# 泛型反射 c#打断点 c# 时间转多少秒 c# 线程函数加参数 c# modbus 读取 c#查询集合表
我们是很有底线的