Can You SSH in and SCP a tar file?

Can You SSH in and SCP a tar file?

Currently I ssh in, create the tar archive, logout, scp the file to my machine, the ssh back in to remove the archive. Not exactly efficient… I know this doesn’t work, but I’m thinking something like:

Is it possible to tar and download over SSH?

Closed 6 years ago. (This seems like an obvious / common question, but I couldn’t find it when searching – maybe I wasn’t using the correct terminology…) I want to login over ssh to a remote machine, tar a directory, and download it to my local machine. I don’t need to leave a copy on the remote server.

How to use tar command through network over SSH session?

The GNU version of the tar archiving utility (and other old versions of tar) can be used through the network over ssh session. Do not use telnet/nc command due to insecure conection. You can use Unix/Linux pipes to create archives.

Is there a way to uncompress a tar file?

The first, simplest way is to create a tar archive on one machine and send it to the other to uncompress. Normally, you would create the archive, scp it to the other machine, then unarchive it. However, you can accomplish the same task in just one easy step with this command:

How can I pipe tar across an SSH session?

9 Answers 9. You can pipe tar across an ssh session: +1 tar-pipe solution. If you have more bandwidth and less CPU you can remove the compression flag (although gzip is pretty lightweight). And you could drop the compression flag and instead activate it in SSH (ssh -C or Compression yes in ~/.ssh/config).

How can I best copy large numbers of small files over SCP?

My source machine is ancient (SunOS) so I’d rather not go installing things on it. You can pipe tar across an ssh session: Tar with bzip2 compression should take as much load off the network and on the cpu. Not using -v because screen output might slow down the process.