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..

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

1 Answer 1

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 [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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .