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.

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?

share|improve this question
1  
That looks fine. What problems are you having with it? –  Mat Dec 5 '13 at 17:21
    
No problems per se, I was just wondering if using process substitution had any ramifications in regard to ssh. –  Gregg Leventhal Dec 5 '13 at 17:36
    
None, ssh is just a process, like any other. –  terdon Dec 5 '13 at 17:39
    
This is exactly the way to do it. –  slm Dec 5 '13 at 18:26

1 Answer 1

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:

ssh-keygen

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 :

ssh root@remote_server_address

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 ...

share|improve this answer

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.