tar backup/ssh problem

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I'm running two Red Hat 8.0 servers.  Server1 is my main file server
(using Samba).  Server2 is a DHCP and an HTTP server for the office
intranet.  Server2 also has a tape drive installed.

For several months I was doing backups from Server1 to the tape drive
in Server2 using a script that contained the line:

tar -cvzf server2:/dev/st0 /shares

This was working perfectly until about a month ago when I installed a
new router for our internet connection.  Now when the script runs I
get the following message:

server2: Connection refused
tar (child): server2\:/dev/st0: Cannot open: Input/output error
tar (child): Error is not recoverable: exiting now
Broken pipe.

Regular SSH connections between the computers are working fine in both
directions.  Previously I had not copied public keys from one system
to the other.  I tried this, hoping to fix the problem.  I can now do
SCP copies without entering the password, but still get the same error
when trying to do the tar backup.  I've also tried sending the tar
file to a regular file (as opposed to the tape drive) on server2 and I
get the same error.  I've tried going in reverse - creating a tar file
on server1 from server2, and I get the same error.  I've tested the
tape drive by creating a tar file directly from server2 and that works

I've also tried both allowing and dis-allowing outside connections
through the router via ssh - I get the same error either way.  The
router is working exactly as it is supposed to - I can connect via ssh
(or my connection is refused - depending on router setting) from
outside the LAN.

ANY assistance in resolving this issue would be GREATLY appreciated!!

Thanks in advance for your assistance.


Re: tar backup/ssh problem

Gregory Cain wrote:
Quoted text here. Click to load it

I wonder if this syntax does use SSH at all; what if you try
   tar -cvzf - /shares | ssh server2 dd of=/dev/st0

Re: tar backup/ssh problem

Job Eisses wrote:
Quoted text here. Click to load it

The first tar syntax uses "rmt", not SSH. It's superior for tape management
in a number of ways, but of course doesn't provide the secure access and
data protection of an SSH connection. I think the original poster needs to
reconfigure his new firewall.

Re: tar backup/ssh problem

Quoted text here. Click to load it

Though "rmt" is not a network protocol but a program, that tar typically
talks to via rexec(3) or rcmd(3) (shudder:-) - so ``"rmt", not SSH''
doesn't really make sense. And of course gnu tar has:

     TAR_RSH          The TAR_RSH environment variable allows you to override
                      the default shell used as the transport for tar.

Wether the OP ever had it set to "ssh", and doesn't anymore, is anyone's
guess, of course - but it certainly works.

--Per Hedeland

Re: tar backup/ssh problem

Per Hedeland wrote:
Quoted text here. Click to load it

      rmt - remote magtape protocol module


      rmt is a program used by the remote dump  and  restore  pro-
      grams  in  manipulating  a  magnetic  tape  drive through an
      interprocess  communication  connection.  rmt  is   normally
      started up with an rexec(3SOCKET) or rcmd(3SOCKET) call.

      The rmt program accepts requests that are  specific  to  the
      manipulation  of magnetic tapes, performs the commands, then
      responds with a status indication.   All  responses  are  in
      ASCII  and  in  one  of  two forms. Successful commands have
      responses of:


Re: tar backup/ssh problem

DharmaFog wrote:
Quoted text here. Click to load it

Opps - I responded to the wrong message - and it launched instead of
aborting (so much for keyboard shortcuts.)

Per's 'shudder' summarizes my comments.

Re: tar backup/ssh problem

Quoted text here. Click to load it

Ah, thanks for the clarification - I was wondering whether I would have
to explain the difference between "protocol" as in "rmt protocol" and as
in "rsh protocol" or "ssh protocol".:-)

Quoted text here. Click to load it

But as I indicated, it works perfectly fine to talk the rmt protocol
over the ssh protocol instead - which is precisely what gnu tar does
when you use the above syntax with environment TAR_RSH=ssh.

--Per Hedeland

Re: tar backup/ssh problem

Quoted text here. Click to load it

The "Connection refused" part is
a classic firewall artifact. The rest is merely tar reporting errors as the
connection error cascades back up through the function call chain that led
to the connection request.

My first thought looking at the
message was "IP tables misconfiguration",
but if you have a hardware router
in the middle with its own firewall,
the two hosts may never be seeing
tar's connect requests.

Good luck.


Clayton Weaver

"Everyone is ignorant, just about different things."  Will Rogers

Site Timeline