Paramiko/Open SSH get env variable paths
When I connect to a windows machine running OpenSSH with paramiko i can't seem to get paths by using the enviroment variable. For instance:
>>stdin, stdout, stderr = _ssh.exec_command('cd %PYTHON_HOME%')
>>print(stderr.read())
>>b'The system cannot find the path specified.\r\n'
>>stdin, stdout, stderr = _ssh.exec_command('cd %SYSTEM%')
>>print(stderr.read())
>>b'The system cannot find the path specified.\r\n'
Any ideas? I know the absolute path of those folders on the server, but I'd rather use env variables as that is the whole point of env variables, to let the target machine determine the location of its own resources.
See also questions close to this topic
-
Delay minimacing due streaming audio to raspberry
I stream the audio from my laptop to my
raspberry
. At the Moment I usepacat
to get the raw data,sox
to convert towav
,ssh
for transportation andvlc
for playback. I usedaplay
previously, but it didn't change anything and I likevlc
:).I think that the delay is produced by
sox
. And now I just wanted to ask the hive mind called Internet if it has an idea to better the situation. Thanks in advance.pacat --record -d alsa_output.pci-0000_00_1b.0.analog-stereo.monitor | sox -V -t raw -b 32 -e signed -c 1 -r 44.1k - -r 32k -t wav -|ssh pi@192.168.2.122 cvlc -
-
Expose Localhost to Remote URL via SSH Tunnel with Python
I am writing a Python library in which I would like to allow users to expose their
localhost
to a URL on a server (let's call itserver.com
), which I can configure as needed. The idea is to allow them to share a local development website with other people.So, for example, if they have a webpage running on
localhost:8000
, they can run a few python commands to forward that toserver.com/custom_url
. Then, other people can interact with that webpage by vistingserver.com/custom_url
.Is it possible to do this? I'm looking at
sshtunnel
library (https://sshtunnel.readthedocs.io/en/latest/), in particular Example 2, but it seems extremely complicated and requires users to set up a private key. I would prefer a way in which the user needs to do as little configuring as possible; it's fine if I need to configure the server in any way. Is there a way I would be able to handle that in Python? -
Capistrano: Permission denied (publickey) though ssh git@github.com works
I'm trying to configure Capistrano to deploy my Node.js project to one of my servers.
I created an ssh key, imported it to github, my server and my machine (with
ssh-add
).ssh-add -l
lists the key, executingssh git@github.com
succeeds - it displays github's default message:Hi myusername! You've successfully authenticated, but GitHub does not provide shell access.
I'm running Ruby 2.6.1 x64, Git 2.20.1 x64 & Windows 10 x64 (with OpenSSH installed via additional system features).
My
config/deploy.rb
file contains the following:lock "~> 3.11.0" set :application, "myproject" set :repo_url, "git@github.myusername/myproject.git" set :ssh_options, { forward_agent: true, keys: 'C:/Users/myusername/mydirectory/id_rsa.pub' } set :branch, "master"
And
config/deploy/production.rb
:server "MYSERVERADDRESS", user: "MYSERVERUSER", roles: %w{apiServer} set :ssh_options, { forward_agent: true, keys: 'C:/Users/myusername/mydirectory/id_rsa.pub' }
Running
cap production deploy
outputs the following:00:00 git:wrapper 01 mkdir -p /tmp Enter passphrase for C:/Users/myusername/mydirectory/id_rsa.pub: MYSERVERUSER@MYSERVERADDRESS's password: ✔ 01 MYSERVERUSER@MYSERVERADDRESS 5.075s Uploading /tmp/git-ssh-myproject-production-myusername.sh 100.0% 02 chmod 700 /tmp/git-ssh-myproject-production-myusername.sh ✔ 02 MYSERVERUSER@MYSERVERADDRESS 0.188s 00:05 git:check 01 git ls-remote git@github.com:myusername/myproject.git HEAD 01 Permission denied (publickey). 01 fatal: Could not read from remote repository. 01 01 Please make sure you have the correct access rights 01 and the repository exists. #<Thread:0x00000000061737b0@C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sshkit-1.18.2/lib/sshkit/runners/parallel.rb:10 run> terminated with exception (report_on_exception is true): Traceback (most recent call last): 13: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sshkit-1.18.2/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute' 12: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sshkit-1.18.2/lib/sshkit/backends/abstract.rb:29:in `run' 11: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sshkit-1.18.2/lib/sshkit/backends/abstract.rb:29:in `instance_exec' 10: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/capistrano-3.11.0/lib/capistrano/scm/tasks/git.rake:18:in `block (3 levels) in eval_rakefile' 9: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sshkit-1.18.2/lib/sshkit/backends/abstract.rb:97:in `with' 8: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/capistrano-3.11.0/lib/capistrano/scm/tasks/git.rake:19:in `block (4 levels) in eval_rakefile' 7: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/capistrano-3.11.0/lib/capistrano/scm/git.rb:38:in `check_repo_is_reachable' 6: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/capistrano-3.11.0/lib/capistrano/scm/git.rb:77:in `git' 5: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sshkit-1.18.2/lib/sshkit/backends/abstract.rb:78:in `execute' 4: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sshkit-1.18.2/lib/sshkit/backends/abstract.rb:145:in `create_command_and_execute' 3: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sshkit-1.18.2/lib/sshkit/backends/abstract.rb:145:in `tap' 2: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sshkit-1.18.2/lib/sshkit/backends/abstract.rb:145:in `block in create_command_and_execute' 1: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sshkit-1.18.2/lib/sshkit/backends/netssh.rb:169:in `execute_command' C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sshkit-1.18.2/lib/sshkit/command.rb:99:in `exit_status=': git exit status: 128 (SSHKit::Command::Failed) git stdout: Nothing written git stderr: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. 1: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sshkit-1.18.2/lib/sshkit/runners/parallel.rb:11:in `block (2 levels) in execute' C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sshkit-1.18.2/lib/sshkit/runners/parallel.rb:15:in `rescue in block (2 levels) in execute': Exception while executing as MYSERVERUSER@MYSERVERADDRESS: git exit status: 128 (SSHKit::Runner::ExecuteError) git stdout: Nothing written git stderr: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. (Backtrace restricted to imported tasks) cap aborted!
Which looks like it fails at the moment of executing
git ls-remote git@github.com:myusername/myproject.git HEAD
. What's strange is that when I rungit ls-remote git@github.com:myusername/myproject.git HEAD
manually, it succeeds (no matter if I do this in cmd or in git bash, I tried them both).I also tried executing
cap production deploy
in git bash, but it is even worse, as it fails at the moment Capistrano expects me to input the RSA key's passphrase, throwingBad file descriptor (Errno::EBADF)
before I am able to type anything, which does not happen when running the same in cmd:$ cap production deploy 00:00 git:wrapper 01 mkdir -p /tmp Enter passphrase for C:/Users/myusername/mydirectory/id_rsa.pub:#<Thread:0x0000000006049d58@C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sshkit-1.18.2/lib/sshkit/runners/parallel.rb:10 run> terminated with exception (report_on_exception is true): C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sshkit-1.18.2/lib/sshkit/runners/parallel.rb:15:in `rescue in block (2 levels) in execute': Exception while executing as MYSERVERUSER@MYSERVERADDRESS: Bad file descriptor (SSHKit::Runner::ExecuteError) from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sshkit-1.18.2/lib/sshkit/runners/parallel.rb:11:in `block (2 levels) in execute' C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/net-ssh-5.1.0/lib/net/ssh/prompt.rb:45:in `noecho': Bad file descriptor (Errno::EBADF) from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/net-ssh-5.1.0/lib/net/ssh/prompt.rb:45:in `ask' from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/net-ssh-5.1.0/lib/net/ssh/key_factory.rb:67:in `rescue in load_data_private_key' from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/net-ssh-5.1.0/lib/net/ssh/key_factory.rb:60:in `load_data_private_key' from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/net-ssh-5.1.0/lib/net/ssh/key_factory.rb:44:in `load_private_key' from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/net-ssh-5.1.0/lib/net/ssh/authentication/key_manager.rb:232:in `block in load_identities' from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/net-ssh-5.1.0/lib/net/ssh/authentication/key_manager.rb:225:in `map' from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/net-ssh-5.1.0/lib/net/ssh/authentication/key_manager.rb:225:in `load_identities' from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/net-ssh-5.1.0/lib/net/ssh/authentication/key_manager.rb:117:in `each_identity' from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/net-ssh-5.1.0/lib/net/ssh/authentication/methods/publickey.rb:19:in `authenticate' from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/net-ssh-5.1.0/lib/net/ssh/authentication/session.rb:85:in `block in authenticate' from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/net-ssh-5.1.0/lib/net/ssh/authentication/session.rb:71:in `each' from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/net-ssh-5.1.0/lib/net/ssh/authentication/session.rb:71:in `authenticate' from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/net-ssh-5.1.0/lib/net/ssh.rb:246:in `start' from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sshkit-1.18.2/lib/sshkit/backends/connection_pool.rb:63:in `call' from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sshkit-1.18.2/lib/sshkit/backends/connection_pool.rb:63:in `with' from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sshkit-1.18.2/lib/sshkit/backends/netssh.rb:176:in `with_ssh' from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sshkit-1.18.2/lib/sshkit/backends/netssh.rb:129:in `execute_command' from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sshkit-1.18.2/lib/sshkit/backends/abstract.rb:145:in `block in create_command_and_execute' from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sshkit-1.18.2/lib/sshkit/backends/abstract.rb:145:in `tap' from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sshkit-1.18.2/lib/sshkit/backends/abstract.rb:145:in `create_command_and_execute' from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sshkit-1.18.2/lib/sshkit/backends/abstract.rb:78:in `execute' from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/capistrano-3.11.0/lib/capistrano/scm/tasks/git.rake:8:in `block (3 levels) in eval_rakefile' from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sshkit-1.18.2/lib/sshkit/backends/abstract.rb:29:in `instance_exec' from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sshkit-1.18.2/lib/sshkit/backends/abstract.rb:29:in `run' from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sshkit-1.18.2/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute' C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/net-ssh-5.1.0/lib/net/ssh/key_factory.rb:116:in `read': Could not parse PKey: no start line (OpenSSL::PKey::PKeyError) from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/net-ssh-5.1.0/lib/net/ssh/key_factory.rb:116:in `block in classify_key' from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/net-ssh-5.1.0/lib/net/ssh/key_factory.rb:61:in `load_data_private_key' from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/net-ssh-5.1.0/lib/net/ssh/key_factory.rb:44:in `load_private_key' from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/net-ssh-5.1.0/lib/net/ssh/authentication/key_manager.rb:232:in `block in load_identities' from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/net-ssh-5.1.0/lib/net/ssh/authentication/key_manager.rb:225:in `map' from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/net-ssh-5.1.0/lib/net/ssh/authentication/key_manager.rb:225:in `load_identities' from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/net-ssh-5.1.0/lib/net/ssh/authentication/key_manager.rb:117:in `each_identity' from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/net-ssh-5.1.0/lib/net/ssh/authentication/methods/publickey.rb:19:in `authenticate' from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/net-ssh-5.1.0/lib/net/ssh/authentication/session.rb:85:in `block in authenticate' from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/net-ssh-5.1.0/lib/net/ssh/authentication/session.rb:71:in `each' from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/net-ssh-5.1.0/lib/net/ssh/authentication/session.rb:71:in `authenticate' from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/net-ssh-5.1.0/lib/net/ssh.rb:246:in `start' from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sshkit-1.18.2/lib/sshkit/backends/connection_pool.rb:63:in `call' from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sshkit-1.18.2/lib/sshkit/backends/connection_pool.rb:63:in `with' from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sshkit-1.18.2/lib/sshkit/backends/netssh.rb:176:in `with_ssh' from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sshkit-1.18.2/lib/sshkit/backends/netssh.rb:129:in `execute_command' from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sshkit-1.18.2/lib/sshkit/backends/abstract.rb:145:in `block in create_command_and_execute' from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sshkit-1.18.2/lib/sshkit/backends/abstract.rb:145:in `tap' from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sshkit-1.18.2/lib/sshkit/backends/abstract.rb:145:in `create_command_and_execute' from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sshkit-1.18.2/lib/sshkit/backends/abstract.rb:78:in `execute' from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/capistrano-3.11.0/lib/capistrano/scm/tasks/git.rake:8:in `block (3 levels) in eval_rakefile' from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sshkit-1.18.2/lib/sshkit/backends/abstract.rb:29:in `instance_exec' from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sshkit-1.18.2/lib/sshkit/backends/abstract.rb:29:in `run' from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sshkit-1.18.2/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute' (Backtrace restricted to imported tasks) cap aborted! SSHKit::Runner::ExecuteError: Exception while executing as MYSERVERUSER@MYSERVERADDRESS: Bad file descriptor Caused by: Errno::EBADF: Bad file descriptor Caused by: OpenSSL::PKey::PKeyError: Could not parse PKey: no start line
Am I missing something in my configuration or is this a problem with Capistrano? Is there any way I can solve this?
Note: I've substituted data like username, github project name or disk paths in the attached all logs & config files
-
Use dictionary instead of list of dictionary to reduce program complexity
Trying to validate the consistency between DynamoDB tables, Used list of dictionary to store dynamodb table items, Which is taking longer time for execution.
New to python, any help to convert List of dictionary to dictionary please, To reduce my program complexity .
#!/usr/bin/python import sys import boto3 import argparse import argparse def table_consistency_check(table, column_name): paginator = dynamoClient.get_paginator('scan') modified_accounts = [] params = { 'TableName': table } page_iterator = paginator.paginate(**params) for page in page_iterator: for item in page['Items']: account = item['account_name']['S'] license_key = item[column_name]['S'] credentials = { 'account_name': account, column_name: license_key } modified_accounts.append(credentials) return modified_accounts if __name__ == '__main__': parser = argparse.ArgumentParser(description='Find all accounts with different license key and account key hash') parser.add_argument('-r', '--region', nargs='?', type=str, default='us-west-2') try: args = parser.parse_args() except: exit_code = int(str(sys.exc_info()[1])) accounts_table = 'accounts_table' Credentail_table = 'credential_table' dynamoClient = boto3.client('dynamodb', region_name=args.region) account1 = table_consistency_check(accounts_table, 'license_key') account2 = table_consistency_check(Credentail_table, 'access_key_hash') output = [] for acct_item in account1: for creds_item in account2: if acct_item['account_name'] == creds_item['account_name']: if creds_item['access_key_hash'].startswith('ORIGINAL_KEY_'): val = creds_item['access_key_hash'] length = len('ORIGINAL_KEY_') str = val[length:] if acct_item['license_key'] != str: output.append(creds_item['account_name']) print('Duplicate record found') print('Account Name : ' + acct_item['account_name'] + ', License Key : ' + acct_item[ 'license_key'] + ', Access Key Hash : ' + creds_item['access_key_hash']) if not output: print('the tables are consistent, No duplicate item found')
-
Storing 3rd Party OAuth Credentials (React)
I'm attempting to implement Google OAuth with the package react-google-login, but I found I had some questions after reading the docs:
ReactDOM.render( <GoogleLogin clientId="658977310896-knrl3gka66fldh83dao2rhgbblmd4un9.apps.googleusercontent.com" buttonText="Login" onSuccess={responseGoogle} onFailure={responseGoogle} />, document.getElementById('googleButton') );
In this example, provided in the usage instructions, the developer's clientId is hardcoded into the component. I'm fairly certain this should never happen, so I wanted to get some clarification as to what the best practice for storing 3rd party authentication credentials actually is.
(Not sure if this is relevant, but I wanted to add that I'll be using a rails backend. I believe I've seen an implementation in the past wherein a request is first made to the backend, where the actual oauth request is then dispatched using credentials that have been stored as environment variables in the server so that they never pass through the browser? If that makes sense?)
Any advice or clarification on this subject would be much appreciated. Thanks in advance!
-
SMTPSenderRefused at /password-reset/ does not work although my environmental variables are set up
I am able to reset password when in settings.py I write this
EMAIL_HOST_USER = "anymail_id@gmail.com" EMAIL_HOST_PASSWORD = "any_password"
But my code does not send mail when I change it to
EMAIL_HOST_USER = os.environ.get('dbu') EMAIL_HOST_PASSWORD = os.environ.get('dbp')
Although my environment variables are set then also my code does not send mail
For proof that my environmental variables are set is that when I run a python
code given below then output comes as:
anymail_id@gmail.com any_password
For this code
import os db_user = os.environ.get('dbu') db_password = os.environ.get('dbp') print(db_user) print(db_password)
I get output as:
anymail_id@gmail.com any_password
This means my environment variables are set.So the why I am not able to send
mail when I writ below Code:
EMAIL_HOST_USER = os.environ.get('dbu') EMAIL_HOST_PASSWORD = os.environ.get('dbp')
When I am writing this in views.py
import os
def about(request): context = { 'dbu1': os.environ.get('dbu') } return render(request, 'blog/about.html', context)
And this in about.html
<h1>{{dbu1}}</h1>
I get the below as my output in my about.html
None
-
Python hangs,during ssh connect using paramiko module
After vm.connect code,it hangs there itself.It is not printing any errors also. It is printing ADD-hostkey in console but after that it hangs on that place,nor errors occuring. it is not printing crossed connect
-
How to generate the encrypt password while generating the private and public keys?
Below code is working fine. I want to know how we can generate the encrypt password while generating the private and public key and Is it possible to pass through paramiko?
Python Version - 2.6.6 paramiko version - 1.7.5 (Ernest)
For generating the private and public key. I'm using below command and providing the password in passphrase.
ssh-keygen -t rsa
Code
import paramiko import os ssh_remote =paramiko.SSHClient() ssh_remote.set_missing_host_key_policy(paramiko.AutoAddPolicy()) privatekeyfile = os.path.expanduser('~/.ssh/id_key') mykey = paramiko.RSAKey.from_private_key_file(privatekeyfile, password='Wey87hjkl') ssh_remote.connect(host, username = 'test1', pkey = mykey) hostin, hostout, hosterr = ssh_remote.exec_command("hostname") source = hostout.read().decode().splitlines() error = hosterr.read().decode().splitlines() print 'source = ',source print 'error = ',error
-
Python: Paramiko - Server Connection Dropped
I am getting the following error (shown below) where my SFTP connection is cut off midway through for some reason. I came across another post and applied some of the suggestions proposed such as increasing the window size and packet size, but it doesn't seem to have resolved the issue. Also, the file I'm trying to download from the SFTP site isn't particularly big. It's only 800 kB. It almost looks like the error is caused by listdir_attr which I use to get the most recent files.
Traceback (most recent call last): File "\\ccl\apps\KDB\uatw\code\plib\venvs\shortlocator\lib\site-packages\paramiko\sftp_client.py", line 843, in _read_response t, data = self._read_packet() File "\\ccl\apps\KDB\uatw\code\plib\venvs\shortlocator\lib\site-packages\paramiko\sftp.py", line 201, in _read_packet x = self._read_all(4) File "\\ccl\apps\KDB\uatw\code\plib\venvs\shortlocator\lib\site-packages\paramiko\sftp.py", line 188, in _read_all raise EOFError() EOFError During handling of the above exception, another exception occurred: Traceback (most recent call last): File "\\ccl\apps\KDB\uatw\code\products\Q\ShortLocator2\ShortLocator.py", line 246, in runShortLocator self.runResponseProcess(kdbconn, SFTPconn) File "\\ccl\apps\KDB\uatw\code\products\Q\ShortLocator2\ShortLocator.py", line 160, in runResponseProcess manualResponseListFiles = SFTPconn.listFiles(self.manualConfirmsPath) File "\\ccl\apps\KDB\uatw\code\products\Q\ShortLocator2\SFTPConnect.py", line 39, in listFiles for fileattr in self.sftp.listdir_attr(confirms_path): File "\\ccl\apps\KDB\uatw\code\plib\venvs\shortlocator\lib\site-packages\paramiko\sftp_client.py", line 246, in listdir_attr t, msg = self._request(CMD_READDIR, handle) File "\\ccl\apps\KDB\uatw\code\plib\venvs\shortlocator\lib\site-packages\paramiko\sftp_client.py", line 813, in _request return self._read_response(num) File "\\ccl\apps\KDB\uatw\code\plib\venvs\shortlocator\lib\site-packages\paramiko\sftp_client.py", line 845, in _read_response raise SSHException("Server connection dropped: {}".format(e)) paramiko.ssh_exception.SSHException: Server connection dropped:
-
bash via ssh: Long lines of output break at 4k
I use SSH to start "bash -s" on a remote system and feed commands to its STDIN.
However, when no TTY is allocated output lines on STDOUT and STDERR get cut off at 4096 bytes.
Reproducing is simple:
ssh localhost bash echo longlong......longer_than_4k_string ^D
The output I get on STDOUT is then truncated or wrapped at 4096 bytes. When using
-t
with SSH things work fine.Why is that, and what can I do to prevent it?
-
SCP working fine. Unable to SSH after SCPing
I was able to ssh in to the server successfully. I ran scp command to copy a folder. After the scp went fine, Am unable to ssh in any more.
OpenSSH_7.6p1 Ubuntu-4ubuntu0.2, OpenSSL 1.0.2n 7 Dec 2017 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 19: Applying options for * debug2: resolving "*.*.*.*" port 22 debug2: ssh_connect_direct: needpriv 0 debug1: Connecting to *.*.*.* port 22. debug1: connect to address *.*.*.* port 22: Connection timed out ssh: connect to host *.*.*.* port 22: Connection timed out
-
On Windows 10 that is well configured with native OpenSSH's ssh-agent, how to have an implementation of git use the ssh-agent configured?
I have configured Native Windows 10 OpenSSH like described here: https://www.makeuseof.com/tag/windows-10-ssh-vs-putty/
Also I have started as a service ssh-agent, added private key, and between restart my private key password's are remembered.
So mainly, I can do the following immediately after a restart without a prompt:
ssh -T git@gitlab.com
However, I don't know how to get any implementation of 'git' to delegate the ssh work to the Windows native ssh-agent, so that I can execute without any prompt a clone like:
git clone git@gitlab.com:SandboxAtHoopSoft/create-aws-accounts.git