Ssh – change scp default directory in `~/.ssh/config`

scpssh

The scp (openssh) command accepts relative paths as host:path/ which are relative to the home directory on the host. I would like to change location of the default directory.

For example, I would like to create a shortcut pseudo-host in .ssh/config along the lines of

Host bar
   hostName foo
   ## this directive does not actually exist:
   DefaultDirectory /home/me/some/path/here  

so that I could write

scp some_file bar:baz

instead of

scp some_file foo:some/path/here/baz

Is it possible with openssh?

Best Answer

The "home" directory is defined by the users' home directory defined in the /etc/passwd file. I don't believe any opensshd parameter will override this behavior. You can change the home-dir of the user... but I don't think this is what you're looking for.