Download File From Ssh Session

Active3 years, 11 months ago
  1. Download File From Ssh Session 2016
  2. Download File Over Ssh
  3. Ssh Download File From Server

I know I can use sftp user@host ..

But what I want is to download a file from the existing session.

that is.

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. PSCP is a tool for transferring files securely between computers using an SSH connection. To use this utility, you should be comfortable working in the Windows Command Prompt. Download the PSCP utility from PuTTy.org by clicking the file name link and saving. Download PuTTY. PuTTY is an SSH and telnet client, developed originally by Simon Tatham for the Windows platform. PuTTY is open source software that is available with source code and is developed and supported by a group of volunteers.

Nov 07, 2016  Users can securely download a file from any remote server with SSH by using the scp tool at the command line. Now, when you connect over SSH or use SCP, you’ll need the proper private key file as well as the proper passphrase. Once you enter your passphrase once, you won’t be asked again for it until you close your session. That means that the first time you SSH/SCP, you’ll need to enter your password, but all subsequent actions won’t require it. SSH (Secure Shell) This is the home page for the SSH (Secure Shell) protocol, software, and related information. SSH is a software package that enables secure system administration and file transfers over insecure networks. It is used in nearly every data center, in every larger enterprise. How to download a file through (Putty) SSH. Is there a way using putty/winscp/anything else to download a file from Server-A to my local PC? Download file.

ssh user@host.. do some work ..

The main problem I have is that said file is under root on the server so doing a sftp command is not that simple.

Der Hochstapler
70.1k51 gold badges239 silver badges292 bronze badges
jorge.vargasjorge.vargas

5 Answers

The way you describe it it sounds like your issue is that you cannot login as root via ssh (probably you used some sort of su or sudo to work as root).

  • If root can in principle log in via ssh, but you do not know the password, you can set up root's account to allow public-key authentication with your key.
  • If that is not possible copy that file to a folder accessible to the account you log in with (like your $HOME folder), possibly adjust permissions and copy as user with sftp or scp.
Benjamin BannierBenjamin Bannier
13.5k3 gold badges37 silver badges37 bronze badges
quack quixote
36.1k11 gold badges89 silver badges123 bronze badges
Session
akidakid

I don't know why it has to be the same session, but if you use ControlMaster and ControlPath in your ~/.ssh/config you don't have to authorize your scp connection since it multiplexes in the same connection. This also speeds up your connection you do to the same host.

Have a look at http://www.linux.com/archive/feed/54498 on how to set it up.

Jimmy HedmanJimmy Hedman

You cannot download 'through' an existing session.

scp and sftp work by creating new sessions and talking to an executable on the other end that's running in place of a shell.

The main problem I have is that said file is under root on the server so doing a sftp command is not that simple.

You are logged into a remote server. I presume you can get to this file under your non-root account. So, scp should work. The user your specify under scp can reach everything as if you were logged in.

If you are needing to sudo or su to get to this file on the remote system, the proper thing to do is copy it to your normal user's home directory, chmod so your normal user owns and can read it, then get it with scp, etc. If the file is very large, chmod the file directly temporarily without making a copy.

Cannot ping windows 7. It has me totally stumped though, so I'm hoping the hive mind can help me out.Essentially, the machine gets an IP address from my network, but cannot reach any websites, and no pings work at all, not even to localhost or 127.0.0.1. All pings result in a 'General failure' error message.

Download File From Ssh Session 2016

Another thing you can try - If you are running your own SSH server at home or wherever, and it's reachable from the remote SSH server you're logged into, you can use scp to send it from your remote session to your local system.

LawrenceCLawrenceC
61.7k12 gold badges109 silver badges186 bronze badges
File

The way I would do what you're asking for would be to turn on session logging on your ssh client (Ways to do this vary. Depending on the file you might get away with just setting a big scrollback buffer.), and then base64 encode the file and blit it to your terminal. :D

You can then trim the extraneous bits off of either end of the log and base64 decode it back into your original file.

Download File Over Ssh

For example:

And then, on the client end:

Ssh Download File From Server

Some client programs have methods built in for doing pretty much the same thing with, say, the XMODEM protocol or similar, but availability of the transmission software on the server side is probably going to be a lot less than for base64, which is included in most of the Linux distros I've used recently. If you have a client that supports it though, it takes care of the chopping and decoding phase automatically, which can be convenient for large files. I don't know that anybody's really used it since the days of telnet BBSs though, so good luck.

PerkinsPerkins

Not the answer you're looking for? Browse other questions tagged sshdownloadsftp or ask your own question.