Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

How to use scp and ssh command in a same script? First I have to copy one file from my local server to remote. Then from local server itself, I have to check the size of the copied file.

share|improve this question
    
What's the rationale for not being able to use SSH keys? Your Q really makes no sense, given you're using SCP and SSH. –  slm Feb 7 at 8:18
    
I'd recommend using rsync to handle the copy and checking with ssh as its backend, then set up a passwordless public/private authentication key for rsync to use. Keep the private key in a directory accessible only to the userid running the rsync script. Done. –  Shadur Feb 7 at 9:25
add comment

1 Answer

I would use public/private key to automate the conection without the need of using a password.

share|improve this answer
    
more coffee OK, but more glasses will probably reduce your sight instead of enhanceing it @Anthon –  Kiwy Feb 7 at 8:36
1  
@kiwi even if going from 0 to 1? –  Anthon Feb 7 at 8:38
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.