Joe: RTFM
SCP(1) FreeBSD General Commands Manual SCP(1)
NAME
scp -- secure copy (remote file copy program)
SYNOPSIS
scp [-1246BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
[-l limit] [-o ssh_option] [-P port] [-S program]
[[user@]host1:]file1 [...] [[user@]host2:]file2
...
-B Selects batch mode (prevents asking for passwords or
passphrases).
Read the red.
According to that, you should be able to supply the password (in the form of a text file or a parameter) if you use -B. Figure it out!
I wish I did man scp earlier. Sending all that Grave Digger to iago would have been quicker with -C and -l 30.
Nah, I've sent .mp3 files with -C before. It sends slower because it takes more processing time but doesn't shrink it very much.
And you should NOT supply the password in the plaintext file. You should set up ssh with public/private keys.
- On your computer, run "ssh-keygen -t rsa". Go through the steps, and give it a blank password.
- Open ~/.ssh/whatever.pub. That's your public key
- Copy your entire public key
- Create a new file on the server, ~/.ssh/authorized_keys
- Put your public key in authorized_keys
Here's a simple way:
ron@slayer:~$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/ron/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/ron/.ssh/id_rsa.
Your public key has been saved in /home/ron/.ssh/id_rsa.pub.
The key fingerprint is:
2b:f3:68:0b:79:81:f1:9d:be:c9:31:b5:d8:1c:42:b3 ron@slayer
ron@slayer:~$ scp .ssh/id_rsa.pub iago@darkside:.ssh/authorized_keys
iago@darkside's password:
id_rsa.pub 100% 220 0.2KB/s 00:00
ron@slayer:~$ ssh iago@darkside
iago@darkside:~$
Notice how I didn't need a password the second time? I cheated, though, by just renaming "id_rsa.pub" to authorized_keys. If I ever wanted to add another key, I'd have to add the public key manually.
Get it?