Determine Stretch vs Jessie in Bash Script - Raspberry Pi Forums


what's correct way determine whether bash script running under stretch or jessie?

i'm running subtle differences. example, under jessie i've been enabling ssh login root user with:

sed -i 's/^permitrootlogin without-password$/permitrootlogin yes/' /etc/ssh/sshd_config

under stretch, 'permitrootlogin without-password' doesn't exist in /etc/ssh/sshd_config

under stretch, need add 'permitrootlogin yes'.

$ cat /etc/issue

or check if "permitrootlogin ..." exists in file , add if not.

of course root login on ssh discouraged practice.


raspberrypi



Comments

Popular posts from this blog

Error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode - Raspberry Pi Forums

class MPU6050 has no member named begin

missing filename after '-o'