Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] tar over an ssh'ed network connection failed
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3925
Location: Hamburg

PostPosted: Sun Jul 24, 2016 8:41 pm    Post subject: [solved] tar over an ssh'ed network connection failed Reply with quote

I know that this worked in the past (hardened amd64 host, x86 kvm) to unpack a new kernel from a local git tree to a kvm machine, but now it fails :
Code:
$ git archive --prefix linux-4.7.x/ v4.7 | (ssh root@n22kvm; cd /usr/src/; sudo tar -tf- 1>/dev/null)
Pseudo-terminal will not be allocated because stdin is not a terminal.
-bash: line 1: pax_global_header00006660000000000000000000000064127452127060014520gustar00rootroot0000000000000052: command not found
-bash: line 2: syntax error near unexpected token `newline'
-bash: line 2: `linux-4.7.x/000077500000000000000000000000001274521270600127775ustar00rootroot00000000000000linux-4.7.x/.get_maintainer.ignore000066400000000000000000000000371274521270600172500ustar00rootroot00000000000000Christoph Hellwig <hch@lst.de>'
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Exiting with failure status due to previous errors
It works fine for the local host:
Code:
$ git archive --prefix linux-4.7.x/ v4.7 | (cd /usr/src/; sudo tar -tf- 1>/dev/null)
Now I do wonder about the issue. It is related to the ssh b/c within the KVM it works fine too :
Code:
# git archive --prefix linux-4.7.x/ v4.7 | (cd /usr/src/; tar -tf- 1>/dev/null)
(nfs mounted the git tree)

Last edited by toralf on Mon Jul 25, 2016 8:01 am; edited 1 time in total
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 21876

PostPosted: Sun Jul 24, 2016 10:30 pm    Post subject: Reply with quote

You are not unpacking a tar archive over ssh. You are sending a tar archive to the shell running as root@n22kvm, then locally running some commands after that ssh exits. Unless root@n22kvm uses tar xf - as its shell, that is highly unlikely to do anything good or useful. You ran (ssh root@n22kvm; cd /usr/src/; sudo tar -tf- 1>/dev/null). You probably should have run ssh root@n22kvm sudo tar -C /usr/src/ -x -f -.
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3925
Location: Hamburg

PostPosted: Mon Jul 25, 2016 8:00 am    Post subject: Reply with quote

*head smack* this works:
Code:
$ git archive --prefix linux-4.7.x/ v4.7 | ssh root@n22kvm "cd /usr/src/; tar -tf- 1>/dev/null"
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum