View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 1 post ] 
Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Sun Jun 13, 2010 11:50 pm 
Offline
Joined: Tue May 11, 2010 2:51 am
Posts: 31
Location: Turin - Italy
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"


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu