LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Need to copy file (scp) to Debian server when reached 150 kb (https://www.linuxquestions.org/questions/linux-newbie-8/need-to-copy-file-scp-to-debian-server-when-reached-150-kb-657024/)

spaceuser 07-20-2008 02:24 PM

Need to copy file (scp) to Debian server when reached 150 kb
 
Hi!

I have a Linux router (Freesco) that runs on a floppy. I had it for years and it have worked very good. Until now, I have copied the router log files manually to my Debian server. I'd like to setup a script that will check if file is near 150 kb in size, and then logon to the server and copy the file to it, using scp. I guess I need to use cron that will run a script now and then. I have used the scp command before a few times, but never using the password within the command line if it's even possible, I don't know for sure. Would appreciate if anyone could give me a hint or two on this.

TIA

/Lars

blackhole54 07-20-2008 03:56 PM

Quote:

Originally Posted by spaceuser (Post 3220836)
I have used the scp command before a few times, but never using the password within the command line if it's even possible, I don't know for sure. Would appreciate if anyone could give me a hint or two on this.

Rather than trying to use a password, you probably want to use public key authentication. This is explained in the ssh man page under the section AUTHENTICATION. There are also numerous articles on the Internet explaining it. Since this will be run automatically, you will need create your private key without a passphrase. Understand that this carries some security risk since anybody acquiring that key will be able to log onto your Debian server with it.

If you create the key pair from your Debian system, be sure the OpenSSH package is up-to-date since an out of date package might contain a horrible security hole that was discovered a few months back.


All times are GMT -5. The time now is 07:58 PM.