You've hit the nail on the head: Ubuntu Core mounts the root filesystem as squashfs which is read-only. All the DEFAULT user authentication files /etc/passwd, /etc/shadow, /etc/group and /etc/gshadow all live on a read-only filesystem. By Snapcraft's DESIGN you can't modify these users.
Only users added with:
sudo adduser --extrausers testusername
Can be modified by the passwd
command. The root user is not one of these. The user authentication files for these supplemental users live in a different path which IS RW:
/writable/system-data/var/lib/extrausers/
Where you'll find writable user authentication files which can be altered by the passwd
command.
NOTE: There is a way of working with System users in the following link, but I'm not sure you'll be able to alter the root
user which is your goal:
https://docs.ubuntu.com/core/en/guides/manage-devices/
WORKAROUND:
Preface the remote command with sudo
:
ssh [email protected] -t 'sudo /bin/sh -c cd /home/yourUser;sudo ./test.sh'
In test.sh you can specify commands which require root perms and the sudo
will execute them successfully. I guess there's other ways of doing it, but it's a starting point. HTH bud- T
sudo su -
from the normal user?