Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I use the following config in my ssh config file:

Host host1
  Hostname host1
  User root 
  ForwardAgent yes 
  Port 22 
  ProxyCommand ssh -q user@host2 nc %h %p 

Is there a way to jump to a specific path when I connect using ssh host1?

I need this for shortening my rsync commands. For example instead of typing:

rsync dir1 host1:/var/www/dir0/dir1/

I want to type:

rsync dir1 host1

share|improve this question
add comment

1 Answer

As you seem to have root access to the remote box, you can add another user with the appropriate rights and a home directory at exactly that place.

This way you can leave out the path, because it's the home directory and you don't have to work as root.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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