Problem using multiple users on squashfs

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Problem using multiple users on squashfs

Pedro Pascual Vázquez
Hello,

I have a problem using multiple users on a system embedded with rootfs
based on squashfs.

In the user database (/etc/passwd and /etc/shadow files) the following
users are correctly configured:

root with uid=0
user1 with uid=101
user2 with uid=102

The squashfs file system is created from the tmp_dir directory, which
contains the root file system of the embedded system:

sudo chown 101 tmp_dir
sudo mksquashfs4.0 tmp_dir squashfs.img -noappend -no-recovery

At system startup, the squashfs image is mounted and becomes the root
file system:

mount squashfs.img /new_root -o ro,loop
cd /new_root
mkdir -p old_root
pivot_root . old_root
exec chroot . /linuxrc

I enter the system and execute:

# su user1

And everything is OK.

But if I execute:

# su user2

Returns the following error:

su: can't execute '/bin/bash': Permission denied

Si al crear el sistema de ficheros se hace:

And if the file system is created in this way (only change the owner of
the tmp_dir directory):

sudo chown 102 tmp_dir
sudo mksquashfs4.0 tmp_dir squashfs.img -noappend -no-recover

I enter the system and execute:

# su user1

Returns the following error:

su: can't execute '/bin/bash': Permission denied

But if I execute:

# su user2

And everything is OK.

Anyone know how to use multiple users in squashfs?

Thank you in advance.

Regards,

Pedro


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Squashfs-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/squashfs-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem using multiple users on squashfs

Ivan Shmakov
>>>>> On 2017-04-27 13:32:52 +0200, Pedro Pascual Vázquez wrote:

 > The squashfs file system is created from the tmp_dir directory, which
 > contains the root file system of the embedded system:

 > sudo chown 101 tmp_dir
 > sudo mksquashfs4.0 tmp_dir squashfs.img -noappend -no-recovery

        Did you try to also $ chmod a+rX tmp_dir already?

        Usually, however, the root directory is owned by root:root and
        is accessible by everyone.  Like:

$ sudo chown -- root: tmp_dir
$ sudo chmod -- a+rX  tmp_dir

 > I enter the system and execute:

 > # su user1

 > And everything is OK.

 > But if I execute:

 > # su user2

 > Returns the following error:

 > su: can't execute '/bin/bash': Permission denied

--
FSF associate member #7257

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Squashfs-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/squashfs-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem using multiple users on squashfs

Pedro Pascual Vázquez
>>>>> On 2017-04-27 13:57 +0200, Ivan Shmmakov wrote:

>        Did you try to also $ chmod a+rX tmp_dir already?
>
>        Usually, however, the root directory is owned by root:root and
>        is accessible by everyone.  Like:
>
> $ sudo chown -- root: tmp_dir
> $ sudo chmod -- a+rX  tmp_dir

This must be the only thing I had not tried :-)

It works perfectly

Thank you very much.

Regards,

Pedro.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Squashfs-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/squashfs-devel
Loading...