pycopia / ssh2-python3 Goto Github PK
View Code? Open in Web Editor NEWFast wrapper for libssh2.
License: GNU Lesser General Public License v2.1
Fast wrapper for libssh2.
License: GNU Lesser General Public License v2.1
Can you prove de an example of specifying preferred mac(s)?
Thanks
I am interested and swapping out paramiko as base ssh driver. Can you provide an example of building an unauthenicated connection. Similar to below paramiko snip.
class SSHClient_noauth(SSHClient):
def _auth(self, username, *args):
self._transport.auth_none(username)
return
Hi, I see on the README that this fork of ssh2-python is supposed to fix "a segfault during garbage collection in certain situations". I may be encountering this. Could you provide any more information about this issue? Here is what I am seeing with ssh2-python 0.22.0:
Thread 144 "python3" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffef7e96700 (LWP 8370)]
0x0000000000000000 in ?? ()
(gdb) wher
#0 0x0000000000000000 in ?? ()
#1 0x00007ffff2bbf91b in _libssh2_channel_free () from /opt/aeva/py3env/lib/python3.6/site-packages/ssh2/../ssh2_python.libs/libssh2-55f304ca.so.1.0.1
#2 0x00007ffff2bbfa07 in libssh2_channel_free () from /opt/aeva/py3env/lib/python3.6/site-packages/ssh2/../ssh2_python.libs/libssh2-55f304ca.so.1.0.1
#3 0x00007ffff154386d in __pyx_pf_4ssh2_7channel_7Channel_2__dealloc__ (__pyx_v_self=0x7ffef96c3c88) at ssh2/channel.c:1575
#4 __pyx_pw_4ssh2_7channel_7Channel_3__dealloc__ (__pyx_v_self=<ssh2.channel.Channel at remote 0x7ffef96c3c88>) at ssh2/channel.c:1547
#5 __pyx_tp_dealloc_4ssh2_7channel_Channel (o=<ssh2.channel.Channel at remote 0x7ffef96c3c88>) at ssh2/channel.c:7775
#6 0x0000000000576737 in frame_tp_clear.lto_priv () at ../Objects/frameobject.c:548
#7 0x00000000005a3c0e in delete_garbage (old=<optimized out>, collectable=<optimized out>) at ../Modules/gcmodule.c:864
and so on. Could this be the same bug you reference?
Please provide an example using interactive shell with multiple write/reads.
Channel execute works once. Additional open_sessions raised an error.
Interactive is not working ie .shell()
Solid examples working example would really be helpful.
Thanks
Steps to reproduce:
Python 3.7
Expected behaviour: [What was expected to happen.]
Interactive does not work.
Actual behaviour: [What actually happened.]
ssh2.exceptions.SocketDisconnectError
Additional info: [Include version of libssh2
and any other relevant information.]
ssh2-python3==1.10.2
Just a request if you could possibly make binary wheel packages for windows as well?
$ docker run --rm -it public.ecr.aws/sam/build-python3.10:latest-x86_64 bash
bash-4.2# pip install ssh2-python3
Collecting ssh2-python3
Downloading ssh2-python3-1.11.1.tar.gz (613 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 613.6/613.6 kB 2.5 MB/s eta 0:00:00
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [6 lines of output]
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/tmp/pip-install-wlztxhc4/ssh2-python3_8e5bb10e4a3f469488c4fdbe80b612ed/setup.py", line 8, in <module>
from Cython.Distutils.extension import Extension
ModuleNotFoundError: No module named 'Cython'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
[notice] A new release of pip is available: 23.0.1 -> 23.2
[notice] To update, run: pip install --upgrade pip
After manual installation of Cython there is another error
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Ilibssh2/include -I/var/lang/include/python3.10 -c ssh2/knownhost.c -o build/temp.linux-x86_64-cpython-310/ssh2/knownhost.o -O3
gcc -pthread -shared -Wl,-rpath=/var/lang/lib build/temp.linux-x86_64-cpython-310/ssh2/knownhost.o -L/tmp/pip-install-qq19ux6x/ssh2-python3_2e993007002f46589797c2c73a8da3b4/build/glibc2.26/src -L/var/lang/lib -lssh2 -lssl -lcrypto -lz -o build/lib.linux-x86_64-cpython-310/ssh2/knownhost.cpython-310-x86_64-linux-gnu.so
/usr/bin/ld: cannot find -lssh2
/usr/bin/ld: cannot find -lssl
/usr/bin/ld: cannot find -lcrypto
collect2: error: ld returned 1 exit status
So I had to manually install libssh2-devel
and openssl-devel
to make it working.
I believe all of this happens because there are no pre-built binaries for Amazon Linux.
So I'm wondering where it's possible to add distributions with pre-built binaries.
Even after successful installation it still doesn't work
ImportError: /var/lang/lib/python3.10/site-packages/ssh2/session.cpython-310-x86_64-linux-gnu.so: undefined symbol: libssh2_userauth_publickey_frommemory
bash-4.2# nm -D /lib64/libssh2.so.1 | grep libssh2_userauth_publickey_frommemory
bash-4.2# nm -D /lib64/libssh2.so.1 | grep libssh2_userauth_publickey
0000000000019e90 T libssh2_userauth_publickey
0000000000019cf0 T libssh2_userauth_publickey_fromfile_ex
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.