libssh

How to use libssh in VS10

前提是你 提交于 2019-12-17 22:24:59
问题 How can I implement libssh as a library my compiler will recognize? I'm using Visual Studio 2010 C++, and I've included the Boost library with no problems, but the process I did with Boost is strange, I can tell libssh will be different. I really don't want to do a DLL file, I want one executable, however I know that DLL files can be embedded inside of executables through .rc scripting. (Then extract and load) I've never had to include a library except for Boost into any of my projects, I

Undefined symbol during link using libssh

两盒软妹~` 提交于 2019-12-14 03:19:23
问题 I am using libssh to accomplish connectivity between two systems, the ssh server is redhat, and the client is CentOS. My code compiles and links just fine, except, at runtime I keep seeing this, [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 socket: 4 [2] Socket connecting, now waiting for the callbacks to work [1] Socket

Does libssh supports sftp server functionality?

时光怂恿深爱的人放手 提交于 2019-12-13 13:42:25
问题 In my project i need to transfer files between a server and multiple clients. The communication between client and server should be encrypted, there should be an authentication by username and password and the protocol should be a common one, so i thought about sftp. There are two c/c++ libraries for ssh: libssh and libssh2, where only the first one provides also server functionality. There is a API documentation for libssh where the client module, involving the submodule sftp, is well

Parse “passwd” command with phpseclib

限于喜欢 提交于 2019-12-12 01:40:04
问题 I tried to parse "passwd" command to my machine with phpseclib but it can't go through the first password typing. Look at the code below. $ssh->write(" passwd $new_user\n $new_user_pw\n $new_user_pw\n "); $ssh->setTimeout(5); echo $ssh->read('root@machine:~$'); Output i got is: Last login: Tue Jun 17 12:23:01 2014 from 109.175.60.43 [root@machine ~]# [root@machine ~]# [root@machine ~]# passwd 8917f498 Changing password for user 8917f498. New password: Or can I do this with another way? Thanks

libssh2 and C++

强颜欢笑 提交于 2019-12-11 10:27:42
问题 When I try to use libssh2 in my C++ class, I keep getting the following errors: undefined reference to `libssh2_session_init_ex' undefined reference to `libssh2_session_startup' If I do the same thing using C, everything works fine. Any help? Following is the build command g++ -Wall -g -I/libssh2-1.2.4/src -I/libssh2-1.2.4/include -L/libssh2-1.2.4/src/obj -L/openssl-0.9.8k/ -L/SecuritySDK/3.0.13/RC/LATEST/security/lib -lssh2 -ldl -lnsl -lresolv -lhash -lhandlers -lcrypto -lssl -lz -lbpwp3

How to link a simple libssh program

浪尽此生 提交于 2019-12-11 09:16:13
问题 Problem: getting a simple program using the libssh library to compile successfully without getting a linker error. Program: #include <iostream> #define LIBSSH_STATIC 1 #include <libssh/libssh.h> #include <stdlib.h> void sftpSession() { ssh_session test_session = ssh_new(); if (!test_session) { throw std::runtime_error("Could not create a session?!"); return; } ssh_free(test_session); std::cout << "Session created & freed successfully." << std::endl; } int main(int argc, char **argv) { std:

link libssh with static library (libssh.a)

狂风中的少年 提交于 2019-12-10 12:07:57
问题 I was trying to link my program with libssh static library. Following is my simple code copied from libssh tutorial: //sshtest.c #define LIBSSH_STATIC 1 #include <libssh/libssh.h> #include <stdlib.h> int main() { ssh_session my_ssh_session; my_ssh_session = ssh_new(); if (my_ssh_session == NULL) exit(-1); ssh_free(my_ssh_session); } I put library file libssh.a into the subdirectory libs/ Then compile it with command gcc sshtest.c -Llibs -lssh -o sshtest The output is bunch of undefined

Compiling a c program on a 64 bit machine with a 32 bit binary

十年热恋 提交于 2019-12-10 00:36:11
问题 I am currently trying to use the libssh.dll library to implement a c program that shall connect to remote computers.I am using gcc to compile the program. When compiling this program, I received this error: i386 architecture of input file 'libssh/bin/libssh.ddl' is incompatible with i386:x86-64 output I tried compiling the program with the -m32 flag, but then i receive these errors: /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-pc-cygwin/4.8.2//libgcc_s.dll.a when searching for -lgcc

When compiling a static libssh2 library as i386 it always returns an x86_64 library

。_饼干妹妹 提交于 2019-12-08 05:01:00
问题 Been working on this for hours now so any insight would be greatly appreciated. I'm trying to compile libssh2 for the iPhone Simulator on OS X (I already have it compiled successfully for the device). I'm using the following environment variables and commands: export DEVROOT=/Developer/Platforms/iPhoneSimulator.platform/Developer export SDKROOT=$DEVROOT/SDKs/iPhoneSimulator3.0.sdk export CC=$DEVROOT/usr/bin/gcc-4.2 export LD=$DEVROOT/usr/bin/ld export CPP=$DEVROOT/usr/bin/cpp-4.2 export CXX=

libcurl with libssh2 - one or more libs available at link-time are not available run-time

泄露秘密 提交于 2019-12-08 01:56:54
问题 I get the following error when trying to ./configure libcurl 7.22.0 one or more libs available at link-time are not available run-time. Libs used at link-time: -lssh2 -lssl -lcrypto -lrt -lz When I ./configure with --without-libssh2 it works just fine. Steps I have taken: apt-get install libssl-dev apt-get install libssh-dev cd /var wget http://www.libssh2.org/download/libssh2-1.3.0.tar.gz tar -zxvf libssh2-1.3.0.tar.gz cd libssh2-1.3.0 ./configure make make install SSL support works fine, by