What is the best way to download files to local hard drive when logged in to another computer using ssh in bash. I'm aware of sftp, but it is not convienent, e.g. it lacks tab completion of directory names. I'm using Ubuntu 8.04.1 . I don't have a public IP and would not like to setup dynamic Dynamic DNS solution.
As far as I know there is no simply scp-on-steroids that lets you autocomplete on remote folder-structures. If you just want to basically mount a remote folder, take a look at sshfs. Or just try mounting a remote directory with ssh://... within Nautilus.
I actually like to use the command line SCP client. :) I do not know how it does this, but my SCP on Ubuntu (from openssh-client 1:4.7p1-8ubuntu1.2) actually does tab-completion of remote directories and files on hosts where I usually auth via public key.
I'm also running Ubuntu 8.04.1, and if I type
$ scp [email protected]:.bashr<TAB>
I do indeed get tab completion (i.e. bash is sshing to my server and getting completion results from the filesystem there). Then
$ scp [email protected]:.bashrc .
copies my .bashrc from my server to the current directory on my local machine.
If you don't get this, try sudo apt-get install bash-completion
, and check that your .bashrc contains the following lines (mine did by default):
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
How about FISH? File transfer over Shell - You can use Midnight Commander in your console:
$ sudo apt-get install mc
$ mc
Then hit F9; Right (for the Right panel) -> Shell link Type in the ssh link of the remote host. At the prompt enter machine name specify:
user@host
The system will prompt for the password (or auto login if your SSH keys are setup for that)
Now you can browse the remote filesystem, select and copy over (F5) as you wish.