You are not logged in.

#1 2021-11-29 23:12:17

Franco_64
Member
From: Milano, Italy
Registered: 2021-11-20
Posts: 49

Owners and permissions on an external Linux device

Hi all,

I need to edit some config files on a Raspberry PI (Raspbian is on a SDHC card, my laptop has an SDHC card reader), that obviously have its login name and password that are different from those I use on my laptop.

How can I do it without generating troubles with owners and permissions?

Last edited by Franco_64 (2021-11-29 23:16:24)

Offline

#2 2021-11-30 00:07:02

lmn
Member
Registered: 2021-05-09
Posts: 93
Website

Re: Owners and permissions on an external Linux device

The login mechanism of the Raspian system is irrelevant when you mount the SD card into your system. In this case the files on the SD card are treated as part of your system, and you can edit them as you would ordinary files.

Every user is essentially just a number. As the first created user on a system generally has (user id) UID 1000 you could be lucky and have it coincide with your UID. In this case you should be able to edit the files.
More generally when editing a file you don't change the file permissions or user, so you can edit files with root permissions (eg via sudo).
Creating new files is a bit more involved as you would need to use chown and chmod to change their permission after they are created, see https://wiki.archlinux.org/title/File_p … attributes for more. Note that chown also accepts UIDs and not just usernames. This also applies to UIDs that have no user associated on the host system.
You can get the right user ids from the `/etc/passwd` file on the SD Card.

Last edited by lmn (2021-11-30 00:10:28)

Offline

Board footer

Powered by FluxBB