I am used to pass commands from my MBE to any SBE in my network via ssh. This is useful to gather information about the SBEs state before switch them off. I normally did this by an sh script and ssh configured to grant access without password.
Since LinHES does not permit ssh being used without password I had to do it in a differente way.
The solution is sshpass, a tiny program that permits to send the password to ssh even from sh scripts.
Here is the procedure I used to add sshpass to my LinHES MBE and to grant SBE access.
First it needs to assign a password to mythtv account in any SBE in the network (I have 2 SBEs) and a few configuration:
sudo passwd mythtv <type the new password twice)
sudo nano /etc/ssh/sshd_config
and type # before DenyUsers mythtv
#From MBE type:
ssh mythtv@<IP of your SBE> (to do just once for each SBE)
answer with yes whenever requested
Then to compile sshpass from source in this way:
sudo pacman -S make
wget
http://downloads.sourceforge.net/sshpas ... .04.tar.gz
tar zxvf sshpass-1.04.tar.gz
cd sshpass-1.04
./configure
make
sudo make install
To check if it works:
/usr/local/bin/sshpass -p 'mythtvpassword' ssh mythtv@<IP of your SBE>
Enjoy
last edited
In my scripts I've also used this way:
sudo /usr/local/bin/sshpass -p '<passwd>' ssh -o StrictHostKeyChecking=no mythtv@<IP_ADDR> "sudo /home/mythtv/bin/ShutdownCheck"