Git fetch/pull/clone hangs on receiving objects
VMware on NAT had this problem for me. Changing it to Bridged (replicate the state) fixed the issue.
VMware on NAT had this problem for me. Changing it to Bridged (replicate the state) fixed the issue.
It is possible using ssh. Python accepts hyphen(-) as argument to execute the standard input, cat hello.py | ssh user@192.168.1.101 python – Run python –help for more info.
I ended up using Jsch- it was pretty straightforward, and seemed to scale up pretty well (I was grabbing a few thousand files every few minutes).
Basically you need to escape it twice, because it’s escaped locally and then on the remote end. There are a couple of options you can do (in bash): scp user@example.com:”‘web/tmp/Master File 18 10 13.xls'” . scp user@example.com:”web/tmp/Master\ File\ 18\ 10\ 13.xls” . scp user@example.com:web/tmp/Master\\\ File\\\ 18\\\ 10\\\ 13.xls .
scp -r user@your.server.example.com:/path/to/foo /home/user/Desktop/ By not including the trailing “https://stackoverflow.com/” at the end of foo, you will copy the directory itself (including contents), rather than only the contents of the directory. From man scp (See online manual) -r Recursively copy entire directories
To do this in Python (i.e. not wrapping scp through subprocess.Popen or similar) with the Paramiko library, you would do something like this: import os import paramiko ssh = paramiko.SSHClient() ssh.load_host_keys(os.path.expanduser(os.path.join(“~”, “.ssh”, “known_hosts”))) ssh.connect(server, username=username, password=password) sftp = ssh.open_sftp() sftp.put(localpath, remotepath) sftp.close() ssh.close() (You would probably want to deal with unknown hosts, errors, creating any … Read more
Use sshpass: sshpass -p “password” scp -r user@example.com:/some/remote/path /some/local/path or so the password does not show in the bash history sshpass -f “/path/to/passwordfile” scp -r user@example.com:/some/remote/path /some/local/path The above copies contents of path from the remote host to your local. Install : ubuntu/debian apt install sshpass centos/fedora yum install sshpass mac w/ macports port install … Read more
Try the Python scp module for Paramiko. It’s very easy to use. See the following example: import paramiko from scp import SCPClient def createSSHClient(server, port, user, password): client = paramiko.SSHClient() client.load_system_host_keys() client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) client.connect(server, port, user, password) return client ssh = createSSHClient(server, port, user, password) scp = SCPClient(ssh.get_transport()) Then call scp.get() or scp.put() to do SCP … Read more