grant fhem root privileges on libreelec via ssh

on libreelec machine:

login via password is libreelec (or openelec)
ssh root@”hostname”
create ssh Directory:

mkdir .ssh

on fhem machine:

allow fhem user login via:

sudo nano /etc/passwd

change Path “/false” to “/bash” (exit nano via “ctrl+x” and confirm changes)

fhem:x:999:20::/opt/fhem:/bin/false
fhem:x:999:20::/opt/fhem:/bin/bash

generate password for user fhem via:

sudo passwd fhem

log in user fhem:

su fhem

generate ssh keys:

ssh-keygen -t rsa -b 4096

copy keys to libreelec:

ssh-copy-id -i /opt/fhem/.ssh/id_rsa.pub root@kodi

test connection (still logged in as fhem user):

ssh root@kodi && exit

exit fhem user session:

exit

disable fhem user login:

change Path “/bash” to “/false” (exit nano via “ctrl+x” and confirm changes)

fhem:x:999:20::/opt/fhem:/bin/bash
fhem:x:999:20::/opt/fhem:/bin/false

delete password for user fhem via:

sudo passwd -d fhem
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s