I would like to compare multiple local files with their counterpart on a remote host, so I'd like to create a script like:
ssh user@remote_host "cat remote_file1.txt" | diff - local_file1.txt
ssh user@remote_host "cat remote_file2.txt" | diff - local_file2.txt
...
ssh user@remote_host "cat remote_fileN.txt" | diff - local_fileN.txt
The problem with such script is that it asks the password for each file. How to make it ask the password just once?