I want to download a file from an active SSH session. In many cases I probably could just use SFTP, scp , rsync et al but there are times where I have elevated permissions on the remote server in a way I cannot use these methods. Root login is disabled because we're not idiots. How do you get that file? Copy it out somewhere less protected and then move it? This is clunky. There are also scenarios where the remote path is complex or temporary, or isn't even a path because I want the output of a remote command stored locally.
Store remotely, then copy? There are several more clunky ways to achieve versions of these but in an ideal world, I would have something akin to local write access from the remote server, using the existing SSH session as a conduit. Something like this is just an artist's impression :. And it just appears in my local cwd. And bidirectional access wouldn't be a bad thing. It's been eight long years since I asked this question and we've seen a real range of clunk, but it remains a problem that I still struggle with occasionally.
I've refactored the question into something a lot more idealistic. I fully understand that there may not currently be a perfect answer. All past and future efforts towards my ideal are appreciated. You may want to check out zssh , which is available in universe, and therefore available with. You need it on your ubuntu server and on your client, but basically when logged in with zssh, you just hit 'ctrl- ' and it brings up the "File transfer mode" which allows you to send files back down the pipe to your client machine, or upload them from client to server.
Assuming you're running an ssh server on your desktop there are ways around this, but I think they all add complexity, and possibly have security problems , you can set up a reverse ssh tunnel. See SSH easily copy file to local system.
I came up with a way to do this with standard ssh. It's a script that duplicates the current ssh connection, finds your working directory on the remote machine and copies back the file you specify to the local machine. It needs 2 very small scripts 1 remote, 1 local and 2 lines in your ssh config.
The steps are as follows:. Step 2: Go back to the PowerShell window, and write cd into the command prompt. Then, after writing cd , right-click with the mouse. By right-clicking, you will paste the location you copied to the clipboard.
Step 3: After executing the cd command, PowerShell will be in the directory where the files are that you want to transfer. While you still need to run a compatible file transfer client pscp or psftp , no new login is required, it automatically if enabled makes use of an existing PuTTY session. Even without connection-sharing, you can still use the psftp or pscp from Windows command line.
Note that the scp is OpenSSH program. Then you're not typing out characters every time you want to pull something, just drag and drop. If your server have a http service you can compress your directory and download the compressed file. If you don't have direct access to the server ip, do a ssh tunnel throught putty, and forward the 80 port in some local port, and you can download the file. I know this question is pretty old now but this can be helpful for newcomers to this question.
It feels like FTP client. Also I don't remember setting up anything on my machine for this. You can use the WinSPC program. Its access to any server is pretty easy. The program gives its guide too. I hope it's helpfull. If you want download your project by Clone URL : you can use command line git clone. Sometimes we need to download just one file for some reason. It is quite obvious that, for more number of files, we can use SFTP. It is difficult to say whether these will work with puTTY , may be with CygWin , it is possible to use the commands.
Windows users possibly need this kind of setup — Translucent Console for Windows. Actually there are lot of ways to download a file from SSH session. But, if you know about Pipe or Pipeline , then it becomes quite easy.
Open up a command line in Windows. Windows 10 already has SCP installed by default. The color contrasts with the yellow, and syntax highlighting is a nice change from the drab command line.
As you can see, you first need to confirm the connection using the RSA fingerprint of the remote server. Replace [UserName] with your own Windows username. Each RSA fingerprint is added on a new line.
0コメント