1

I want to enable root login for snappy ubuntu OS but root file system is mounted in Read Only mode. I tried so many ways to moun it in Read/Write mode but no success. When I execute sudo passwd command response like below

passwd: Authentication token manipulation error passwd: password unchanged

I think it's only because of no write permission in root file system. I tried commands like sudo mount -o remount,rw /

still its not mounted in R/W mode. Please help..

  • I wanted to enable root login for SSH connection. I don't want to use sudo keyword in each command. – SAMIR SHAIKH Feb 13 '17 at 6:48
  • 1
    Why not just log into the root shell with sudo su - from the normal user? – Kyle Feb 13 '17 at 6:52
  • No, I want to run some commands remotely like winrm and wsman. So it needs root privileges. – SAMIR SHAIKH Feb 13 '17 at 12:49
  • I want to confirm whether root file system can be mounted in R/ W mode in snappy Ubuntu core? – SAMIR SHAIKH Feb 14 '17 at 6:42
  • 1
    I'm afraid not-- it's backed by a squashfs image, which is by definition read-only. – Kyle Feb 14 '17 at 19:08
0

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 yourUser@1.2.3.4 -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

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.