Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
scp pasword in a script
Name: francisco Date: December 3, 2003 at 06:56:18 Pacific OS: linux CPU/Ram: pii 256mb
Comment:
I want to use scp to copy files from a cron job from one linux to another linux. I notice that the scp does not have a "batch" option. Is there a way to get scp to copy files without asking for a password?
Name: 3Dave Date: December 3, 2003 at 08:57:45 Pacific
Reply:
By using public and private keys you can ssh, scp and rcp without the need for entering passwords. "man ssh" for more info.
0
Response Number 2
Name: 3Dave Date: December 3, 2003 at 08:59:51 Pacific
Reply:
Just had a look at the man page for scp and there is a -B switch for batch mode....
0
Response Number 3
Name: francisco Date: December 4, 2003 at 04:10:08 Pacific
Reply:
Í just try the -B option but seems not to work. I have using openssh 3.5p1-107.
0
Response Number 4
Name: 3Dave Date: December 4, 2003 at 06:51:38 Pacific
Reply:
I think the easiest way would be to use RSA/DSA keys stored in $ClientHome/.ssh/[ida_dsa/id_rsa] which are compared to $RemoteHome/.ssh/authorized_keys when connecting. If all is well you should just be able to pass the command: $ scp /path/to/foobar username@hostname which will copy the file foobar to the user's home directory on the remote server without asking for a pasword.
Summary: simply trying to write a startup (and shutdown) script (bash) for nstats. I need to get the pid of the just launched nstats, but in a script "&" doesn't give the pid like it does from the prompt. so I...
Summary: Hi there. I want to use rsync in a shell script. To get rsync to read 2 files the syntax requires a space separated list enclosed in single quotes e.g. rsync -e ssh -avz root@server:'/etc/file1 /etc...
Summary: I am trying to write a script that types in the gpg passphrase and I can't get it to work I can get the phassphrase to echo back by doing gpg --passphrase-fd 0 | echo passphrase. Does anyone know how...