I remote copied a file to my laptop using:
scp someFile USER@192.168.178.32:/home/USER/put/it/some/where/oh/damn/you/here
I want to be able to autocomplete the remote path by hitting tab.
Make sure that you've turned on the fancy autocompletion. On many distributions, this means your
~/.bashrc needs to contain
You'll need to have passwordless authentication set up, i.e. with a key that's already loaded in
Establishing an SSH connection is slow, so you can considerably speed up completions by establishing a connection once and for all and using that connection thereafter. The relatively complicated way to do that is to open a master SSH connection with
ssh -N -M target-host after setting up master-slave connections in
~/.ssh/config; see Multiple ssh sessions in single command for instructions (you need the
The simple method is to mount the remote filesystem over SSHFS and use
cp with normal shell completion.
mkdir ~/remote sshfs USER@192.168.178.32:/home/USER ~/remote cp -p someFile ~/remote/put/it/some/where/oh/damn/you/here
All I needed to do was to add my public key to the remote machine:
cat ~/.ssh/id_rsa.pub | ssh USER@192.168.178.32 "cat - >> ~/.ssh/authorized_keys"
You could switch to lftp instead of using scp. It gives you a nice consistent interface for file transfer over ftp, sftp and ssh including the autocomplete you are looking for and more (i.e. wildcards).
opens a connection over ssh like you do above with scp. Many machines support sftp:// too which is even nicer in my experience.