![]() I know how to use the cp and ssh commands but Im not sure how to use them in order to transfer files from one computer to another. So if you want to copy the file My_file. ssh folders/files to a new computer and keep getting a 'not a regular file' response. Thats also why tunnels inside tunnels work Goodies gave the answer you were looking for I think. Basicly your command/shell works just like it wasnt in a tunnel (the beauty about ssh). scp My_file.txt is, to copy the file to your desktop you might want to transfer it to /home/erez/Desktop/: scp My_file.txt using the shortcut: scp My_file.txt using a relative path on the remote side, which is interpreted relative to your home directory: scp My_file.txt already mentioned, you also have to swap the arguments, it has to be scp FROM TO As B Layer pointed out whenever, you are in a ssh tunnel your command/shell doesnt really know this. If path to your home is something like /home/erez try the following: scp My_file.txt can substitute the path to your home directory with the shortcut ~/, so the following will have the same effect: scp My_file.txt can even leave out the path altogether on the remote side this means your home directory. The destination path is optional, but can be a directory on the server, or even a file name if copying a single file. ![]() My approach: ssh paramiko.SSHClient() ssh.setmissinghostkeypolicy(paramiko.AutoAddPolicy()) ssh.connect(192.168.1.1, 22, root, root) sftp ssh.opensftp() sftp.put(localfile, remotefile) sftp. What you want to do is to transfer them to your home directory (since you have no permissions to write to /). I want to copy a file in python(3.4) using the paramiko library. I can only cd to my local Mac Downloads directory when I exit my ec2 host. In fact, the problem I am having is, I am on the Amazon host (through ssh), so when I do cd, I can only see the files on my Amazon server, not my local Mac Downloads directory where I saved my pem file. Your commands are trying to put the new Document to the root ( /) of your machine. 1 What terminal command can I use to transfer a directory from a remote machine (linux) to my local machine (mac) Most importantly, I'd like to do this from the command line while SSH'ed into the remote machine. Yes, I can ssh with that key to my AWS host.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |