0

I have recently set up a home/work VPN connection via the openconnect client (i don't know if this matters) and I am able to login into the various gateway machines at work, but I am unable to scp , or rsync to anything that is behind those gateways.

So, I can do a ssh gateway and then, after I'm in the server, I can execute ssh work_machine. So, standard, interactive ssh works. Next, I have tried to scp and rsync to the work_machine. In order to achieve this , I made a jump host entry in the .ssh/config:

Host work_machine
    Hostname work_machine_hostname
    ProxyJump gateway
    User user

However, trying to do a scp /local/path/file work_machine:/remote/path just hangs. This happens with rsync, too.

Does anyone have a clue what is going on?

UPDATE

I have tried with tunneling, too. I made a tunnel to the gateway, while keeping the jump host config for the work_machine . Again, I can ssh into the work_machine, but I can't scp, or rsync to it.

I think I'm going back to the good old tunneling until the rest of the utilities catch up. It's one script extra to set up the ports on the local machine, but it's reliable.

By the way, the ssh client is 7.3p1 on Ubuntu 16.10 .

UPDATE 2

Totally removed jump hosts and went back to tunneling.

So,

ssh -f -N -L 12345:gateway1:22
ssh -f -N -L 12346:gateway2:22 gateway1

Host tgateway2
    Hostname localhost
    Port 12346
    User user

Now the last tunnel,

ssh -f -N -L 12347:work_machine tgateway2

and

Host twork_machine
    Hostname localhost
    Port 12347
    User user

This setup used to enable me to access twork_machine directly, even if it was hidden behind two gateway machines. scp and rsync used to work, too. Now only interactive ssh , as in ssh twork_machine works, but no scp and rsync. The scp command just hangs at the step scp -v -t (from the verbose output of scp somefile twork_machine:)

  • What happens when you try to ssh into work_machine from outside? Does that work, or does it hang like the non-interactive tasks? – Daniel H Feb 7 '17 at 14:55
  • No, just logging into the work_machine from the outside works fine. – Mali Remorker Feb 7 '17 at 14:59
  • Huh. And that’s with the host entry so you don’t need to type gateway? I’m not sure why it would work interactively but not for scp and rsync. – Daniel H Feb 7 '17 at 15:01
  • Yeah, it's with the host entry. Maybe it's one of these things where I need to clean up my work environment and then everything is going to magically work. For the moment I can't, have some important interactive sessions open. – Mali Remorker Feb 7 '17 at 15:06
0

Everything was fine on the ssh/scp/rsync side of things. What caused a problem was that .login file of the csh shell which is the default on the work_machine was set up to load bash (via bash -l). For some reason, this switching of shells confused scp and rsync, but not ssh.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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