Psftp download file linux to windows






















What are you trying to accomplish with sftp? I'm tricky to do this through the command line,. Is this possible? Originally Posted by trickydba.

Last edited by schneidz; at PM. Here is an example using a file. Last edited by Turbocapitalist; at PM. Originally Posted by schneidz. I was kinda hoping to get a one-liner that would handle moving a file from linux to windows. The destination server does not need a password. Originally Posted by Turbocapitalist. Either way, you have to have the key set up so that it is in the agent if it has a passphrase recommended or without a passphrase not recommended.

Because batch mode only works when there is no interactive session. Im sorry, your code seems a little confusing And no password is needed, keys already installed.

The stdin example is one line. The backslash is not necessary and is added for readability. The file-based example is also one line, but does need the file filled with SFTP commands. Both work as long as you can use keys for authentication. If you are using expect instead of keys then you are probably SOL. BB code is On. Smilies are On. All times are GMT The time now is AM. Twitter: linuxquestions. Open Source Consulting Domain Registration. Some purists prefer not having to install extra utilities.

Other people simply prefer the command line because it gives you more control and a faster way to tell the utility what you want it to do. This client also comes with a bunch of other utilities, and SFTP is among them. To log in to a server with the sftp command, you use the exact same syntax as with the ssh command. This will download to your current directory, the one you were in locally before you logged in to the server.

To download to a specific local directory on Windows :. Note : even if you incorrectly use forward slashes for Windows paths, in sftp, it seems the utility will understand them. Paths can also be relative. The remote paths can also be relative, which means that if you log in with sftp john To copy directories, you have to add the -r parameter to the command, which stands for recursive. Uploading files or directories follows the same principles. So specify a new name for a directory you want to copy those files to.

When you transfer a large file, if it gets interrupted, you can resume by replacing the previous command with reput and reget instead of put and get. You can echo the commands to a temporary file and then use that if you want a single file solution. The Overflow Blog. Who owns this outage? Building intelligent escalation chains for modern SRE. Podcast Who is building clouds for the independent developer? Featured on Meta. Now live: A fully responsive profile. Reducing the weight of our footer.

Linked Related Hot Network Questions. Stack Overflow works best with JavaScript enabled.



0コメント

  • 1000 / 1000