I’m sorry, but changing the user doesn’t work here as you described.
I upload the file to the data directory with scp:
scp /home/lenovo/Letöltések/data/* root@192.168.1.200:/home/scratchpad1/.local/share/containers/sto
rage/volumes/firebird3-data/_data/
After uploading, the files in the data directory are owned by root (it was uploaded as root):
root@debian-ns8:~# ls -all /home/scratchpad1/.local/share/containers/storage/volumes/firebird3-data/_data/
összesen 559040
drwxr-xr-x 2 952051 952051 4096 ápr 14 19.25 .
drw-r--r-- 4 952051 952051 4096 ápr 14 10.09 ..
-rw-r----- 1 root root 1466368 ápr 14 19.25 ForGrant.fdb
The files in the data directory should be owned by the firebird user, but under Debian (NS8 op system) there is no firebird1 or firebird user.
root@debian-ns8:~# chown firebird:firebird /home/scratchpad1/.local/share/containers/storage/volumes/firebird3-data/_data/*
chown: invalid user: ”firebird:firebird”
In the firebird3-app pod (container) running under scratchpad, there are only firebird user and group. If I enter the scratchpad and within it the firebird3-app container, the owner of the files in the /var/lib/firebird directory is the firebird user.
root@debian-ns8:~# runagent -m scratchpad1
runagent: [INFO] starting bash -l
runagent: [INFO] working directory: /home/scratchpad1/.config/state
scratchpad1@debian-ns8:~/.config/state$ podman exec -ti firebird3-app bash
root@f8cd6d08f0f6:/# ls -all /var/lib/firebird/data
total 1664
drw-r--r-- 4 firebird firebird 4096 Apr 14 10:09 .
drwxr-xr-x 3 root root 4096 Apr 11 20:36 ..
-rw-r----- 1 root root 1466368 ápr 14 19.18 ForGrant.fdb
If I want to change the owner of the files from root to firebird here, I get this:
root@f8cd6d08f0f6:/# chown firebird:firebird /var/lib/firebird/data/hessyneszkoz/*
chown: changing ownership of '/var/lib/firebird/data/hessyneszkoz/ForGrant.fdb': Operation not permitted
The same situation occurs if I want to issue the command from scratchpad because there is no firebird or firebird1 user here.
scratchpad1@debian-ns8:~/.config/state$ chown firebird:firebird /home/scratchpad1/.local/share/containers/storage/volumes/firebird3-data/_data/hessyneszkoz/*
chown: invalid user: ‘firebird:firebird’
If I query the file permissions as Debian root, I see this:
root@debian-ns8:~# ls -all /home/scratchpad1/.local/share/containers/storage/volumes/firebird3-data/_data
összesen 4180756
drwxr-xr-x 2 952051 952051 20480 ápr 14 19.20 .
drw-r--r-- 4 scratchpad1 scratchpad1 4096 ápr 14 10.09 ..
-rw-r----- 1 root root 1466368 ápr 14 19.18 ForGrant.fdb
This is interesting because the 952051 user and group ascratchpad are the numeric identifiers of the firebird user and group in the firebird container (pod). Since the database file is owned by root due to the root upload, the only way to change the file owner is here. If I issue the following command as Debian root:
root@debian-ns8:~# chown 952051:952051 /home/scratchpad1/.local/share/containers/storage/volumes/firebird3-data/_data/*
Then the file will be owned by the firebird user in the firebird container (pod) running under scratchpad:
root@f8cd6d08f0f6:/# ls -all /var/lib/firebird/data
total 1664
drw-r--r-- 4 firebird firebird 4096 Apr 14 10:09 .
drwxr-xr-x 3 root root 4096 Apr 11 20:36 ..
-rw-r----- 1 firebird firebird 1466368 ápr 14 19.18 ForGrant.fdb
This is the only way I found to change the owner of uploaded database files. This problem is mentioned in one of the debian forums as a rootless container problem, but no solution was given. If you know of a simpler solution, please share it with me.
Now that I have managed to upload it, and set up the owner, albeit awkwardly, I will start testing the connection with the program as the next step. Then we will move on…
Thanks for your help @mrmarkuz