ChinaUnix.net
相关文章推荐:

libssh2 windows 编译

linux编译libssh2时问题如下, /usr/bin/ld: /opt/openssl/lib/libcrypto.a(hmac.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC /opt/openssl/lib/libcrypto.a: could not read symbols: Bad value collect2: ld returned 1 exit status 有哪位大侠知道怎么解决吗? openssl编译时已经使用了./config -fPIC参数,谢谢了。

by maxer025 - Linux环境编程 - 2013-05-21 09:25:08 阅读(4583) 回复(6)

相关讨论

#include #include #include #include #include #include #include #include <libssh2.h> int connect_to_host(const char *host, char* port) { /* 省略建立socket和tcp连接的代码 */ return sockfd; } int main(int argc, char *argv) { int sshfd; libssh2_SESSION *session; libssh2_CHANNEL *channel; /*...

by Sam1860 - C/C++ - 2007-11-24 11:05:02 阅读(5196) 回复(2)

gcc -DHAVE_CONFIG_H -I../include -I../example -g -O2 -MT ssh2.o -MD -MP -MF .deps/ssh2.Tpo -c -o ssh2.o ssh2.c mv -f .deps/ssh2.Tpo .deps/ssh2.Po /bin/sh ../libtool --tag=CC --mode=link gcc -g -O2 -o ssh2 ssh2.o ../src/libssh2.la 这个ssh2可以用 libtool: link: gcc -g -O2 -o .libs/ssh2 ssh2.o ../src/.libs/libssh2.so -lssl -lcrypto -lz 这个ssh2运行就失败了 ./ssh2: symbol lookup error:...

by yang3696548 - C/C++ - 2013-08-08 09:46:07 阅读(1218) 回复(0)

如题 libssh2 开发调查 :em51:

by manULinux - C/C++ - 2011-11-03 12:08:56 阅读(2709) 回复(0)

想做一个类似ssh客户端的东西,很简单的小程序,功能就是连接到远程主机,然后执行2-5个命令,使用的是libssh2库,刚刚接触遇到了好多问题。 首先是连续执行多个命令。 生成session----channel---后,使用libssh2_channel_exec执行需要的命令,但是只能执行一次,接着执行第二次的时候就返回错误,不知道应该怎么处理。 其次是依赖的库,不同环境下编译libssh2结果的动态库依赖好像差别很大 然后是超时的问题 望指教,谢谢

by lukygt - C/C++ - 2013-04-26 12:59:29 阅读(8559) 回复(11)

libssh2中给出的示例中有这样一段代码 waitsocket(int socket_fd, libssh2_SESSION* session) { struct timeval timeout; int rc; fd_set fd; fd_set *writefd = NULL; fd_set *readfd = NULL; int dir; timeout.tv_sec = 10; timeout.tv_usec = 0; FD_ZERO(&fd); FD_SET(socket_fd, &fd); dir = libssh2_session_block_directions(session); if(dir & libssh2_SESSION_BL...

by wh007007 - C/C++ - 2011-06-05 14:44:25 阅读(3813) 回复(3)

本帖最后由 baidu9833 于 2010-05-11 14:30 编辑 快要崩溃了... 想破头 用了各种办法都无法解决 希望各位大侠不吝赐教啊[code]/* purpose: to check out the functions of libssh2 */ #include "libssh2_config.h" #include <libssh2.h> #include <libssh2_sftp.h> #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HVAE_UNISTD_H #include

libssh2socket求助

by baidu9833 - C/C++ - 2010-05-14 12:20:25 阅读(6802) 回复(10)

主要把代码做了分离。稍作修改可以做交互式的执行命令。 libssh2_exec.h [code] #ifndef __libssh2_EXEC_H #define __libssh2_EXEC_H #include "libssh2_config.h" #include <libssh2.h> #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif # ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_ARPA_INET_H # include #endif ...

by diyself - C/C++ - 2010-01-13 15:15:59 阅读(5247) 回复(10)

libssh2_userauth_password(session, "root", "123"); 用户名为root,密码为123保证没有错,但是为什么验证通不过啊?运行后返回值为-18,返回值应该是0才是验证通过吧。 socket/connect/session创建都已经验证过,没有任何问题,端口为22肯定也没错,可是为什么运行libssh2_userauth_password(session, "root", "123")就验证不过啊? 用SecureCRT软件选择ssh2方式输入同样的IP,用户名和密码登录是正常的,说明我的linux主机ssh2是...

by bress111 - Linux环境编程 - 2012-07-18 17:55:45 阅读(1120) 回复(0)

libssh2_userauth_password(session, "root", "123"); 用户名为root,密码为123保证没有错,但是为什么验证通不过啊?运行后返回值为-18,返回值应该是0才是验证通过吧。 socket/connect/session创建都已经验证过,没有任何问题,端口为22肯定也没错,可是为什么运行libssh2_userauth_password(session, "root", "123")就验证不过啊? 用SecureCRT软件选择ssh2方式输入同样的IP,用户名和密码登录是正常的,说明我的linux主机ssh2是...

by bress111 - C/C++ - 2012-07-18 17:55:07 阅读(430) 回复(0)

想做一个scp的脚本 用到libssh2库 “”“ apt-get install libssh2-1-dev zlib1g-dev python-dev cd ssh4py python setup.py build python setup.py install ”“” 测试代码如下 #! /usr/bin/python import socket import libssh2 import os def ssh2_scp (server_ip,server_port,usr_name,pw,local_path_name,server_path_name): sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect((server_ip, ...

by forest0823 - Python - 2012-05-22 21:18:46 阅读(1580) 回复(3)