What is the proper way to do something like this:
diff <( ssh -t myuser@hosta 'sudo httpd -M') <(httpd -M)
When I want to compare the output of the 2 commands, the first on a remote host the second local?
Is this the proper method?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
first you have to set public key base authentication in between both server. how you can set both server public key base auth:
NOTE:- Enter all commands on local server
first generate ssh key:
then set that key for authenticate remote server:
ssh-copy-id -i ~/.ssh/id_rsa.pub root@remote_server_address
after done all this check that public key is working proper or not :
if no password promt for login, i mean without password if you can login then ssh key is working proper.
now use your command local server :
diff <( ssh -t myuser@hosta 'sudo echo "test1"') <(echo "test2")
Now your command will show you proper output ...