chmod and chown not doing anything

armigo

New Member
Mar 28, 2023
4
0
1
Hello everyone,

I am trying to give a user in an LCX write permissions to a mounted smb share. However, whether I try on the host or in the container neiter chown to change ownership nor chmod to change write permission has any effect whatsoever.

I tried it with
Code:
sudo chmod -R 0777 /home/armin/

and

Code:
sudo chown -R armin home/armin

inside the container which is privileged.

I also tried to change ownship in the host system to a user with the same uid as the the user in the container but whatever I try the command runs without error but permissions and ownership are completely unaffected.


The container setup looks like this

Code:
arch: amd64
cores: 2
features: nesting=1
hostname: rstudio
memory: 32768
mp0: /mnt/pve/r-projects,mp=/home/armin/r-projects
mp1: /mnt/pve/data-archive,mp=/home/armin/data
net0: name=eth0,bridge=vmbr0,firewall=1,hwaddr=3E:82:0C:DF:38:D4,ip=dhcp,ip6=dhcp,type=>
onboot: 1
ostype: ubuntu
rootfs: app:subvol-108-disk-1,size=200G
swap: 65536

The folders need to be mounted in the user folder because RStudio Server that is running in the container is using the user folders as home directories.


I am little at a loss here because I get no error just nothing happens.

Thanks a lot!
 
Rule 1:
If you do chmod 777 you are doing it wrong (The exception is /top and there it is chmod 1777)

If you have an unprivileged container the uids are +100000, so root (uid 0) in the Container is 100000 on the host.

You could do your smb mount inside the Container, or if your User has the uid 1007 you could chown 101007 on your host.

If you uid on the host is smaller 100000 your Container can not access/change it
 
I am having the same issue as OP. I have a turnkey linux samba file share hosted on one unprivileged ubuntu container, with read/write access on the pve host, and read access via bindmounts on several unprivileged ubuntu containers to which I would like to also grant write access. I believe I understand the user:group mapping process adequately and have tried approaching it from several different angles, but no matter what I do the chmod and chown commands do not return any results when run in the pve host. The CLI pauses for a moment as though it is processing before returning to the next line, but the commands do not actually change user permissions in any way. I have been following the method outlined here. I'm out of ideas and would really appreciate any insight the community may be able to offer.
 
To change the owner/group of the mounted mountpoint of a SMB share you can use the mount options. Like: "uid=1000,gid=1000,file_mode=0660,dir_mode=0770"
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!