Davespice wrote:
I've managed to SSH into the box using PuTTY and openelec / openelec.
Is it possible to edit the /etc/sshd_config file? I just want to make it also listen on another port number.
I tried to edit the file using vim but was prevented from saving by read only permissions on the file.
It's not that the /etc/sshd_config file has read-only permission, it's that the entire root (/) filesystem is mounted read-only as it's a
"loopback" filesystem - the root filesystem in OpenELEC is actually the contents of the single SYSTEM image file you put on your SD card. Long story short, you can't change anything in the root filesystem unless you roll your own SYSTEM file.
Some services in OpenELEC do have configuration files that may optionally exist in ~/.config (which is a read-write area of your /storage partition) - if you create a config file here (eg. samba.conf) it will take precedence over any equivalent file in /etc. However, sshd isn't one of these.
What you might be able to do is create (as user root) a file called "autostart.sh" in ~/.config and also store your own sshd_config in ~/.config.
It's a hack but it should work, try something like the following in ~/.config/autostart.sh:
Code: Select all
killall sshd
/usr/sbin/sshd -f ~/.config/sshd_config
When OpenELEC boots, it will start sshd normally using it's default settings (/etc/sshd_config) but just as OpenELEC brings up XBMC it will run "sh autostart.sh" (assuming it exists) and using the above lines can be used to kill the running sshd server and restart it with your own configuration and any extra ports/options you require.