You are not logged in.

#1 2021-01-23 14:06:19

860lacov
Member
Registered: 2020-05-02
Posts: 497

[SOLVED] Access directory placed in another directory without permiss

Two users
jm
mag_ja

The Structure looks like this:

~/home/jm/Vbox/vmmachine.vbox

I would like to give mag_ja an acces to Vbox directory.

I changed ownership for Vbox from jm:jm to jm:vboxusers
jm and mag_ja are in vboxusers group

I would like to run VirtualBox on mag_ja accout and add there vmmachine.vbox
But jm home has an ownership set to jm:jm

Is it possible to make this work withot changing full path "~/home/jm/Vbox/vmmachine.vbox" to jm:vboxusers
?

Last edited by 860lacov (2021-02-08 23:02:06)

Offline

#2 2021-01-23 15:26:45

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,624

Re: [SOLVED] Access directory placed in another directory without permiss

You can be *in* that directory, but you can't traverse the directory you don't have sufficient permissions for.

You could bind-mount ~/home/jm/Vbox (sidebar: is that the *actual* path, ie. do you have a directory /home/jm/home/jm ? - "~" is shorthand for $HOME which is typically /home/<your user name> …)

sudo mount -o bind /home/jm/Vbox /home/mag_ja/VBox # this assumes /home/mag_ja/VBox exists and sane $HOME directories

nb. that mag_ja will also require proper access to all files in there, eg. vmmachine.vbox

Online

#3 2021-01-23 18:09:13

860lacov
Member
Registered: 2020-05-02
Posts: 497

Re: [SOLVED] Access directory placed in another directory without permiss

seth wrote:

You can be *in* that directory, but you can't traverse the directory you don't have sufficient permissions for.

You could bind-mount ~/home/jm/Vbox (sidebar: is that the *actual* path, ie. do you have a directory /home/jm/home/jm ? - "~" is shorthand for $HOME which is typically /home/<your user name> …)

sudo mount -o bind /home/jm/Vbox /home/mag_ja/VBox # this assumes /home/mag_ja/VBox exists and sane $HOME directories

nb. that mag_ja will also require proper access to all files in there, eg. vmmachine.vbox

The directory is VirtualBox VMs and actuall path is:
~/VirtualBox VMs
As you said mag_ja

will also require proper access to all files in there, eg. vmmachine.vbox

mag_ja is in vboxusers gruop
I did

sudo mount -o bind /home/jm/VirtualBox\ VMs/ /home/mag_ja/VirtualBox\ VMs/

and

chown jm:vboxusers -R /home/jm/VirtualBox\ VMs/

I can access Virtual Box machines on both accounts but mag_ja can't open machine in virtual box because of privileges problem. Any advice about this?

p.s.
By mistake, I reported your answer. Sorry for that.

Offline

#4 2021-01-23 18:12:12

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,700

Re: [SOLVED] Access directory placed in another directory without permiss

860lacov wrote:

p.s.
By mistake, I reported your answer. Sorry for that.

No worries wink


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#5 2021-01-23 18:30:28

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,510
Website

Re: [SOLVED] Access directory placed in another directory without permiss

I'd guess the relevant files are not group writable.  Post the actual error messages as well as the current permissions of the file(s) in question.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#6 2021-01-23 19:05:29

860lacov
Member
Registered: 2020-05-02
Posts: 497

Re: [SOLVED] Access directory placed in another directory without permiss

Trilby wrote:

I'd guess the relevant files are not group writable.  Post the actual error messages as well as the current permissions of the file(s) in question.

Of course, you are right.
vboxusers group didn't have write permission.

I managed after change to 660 I was able to add virtual machine to virtual box on mag_ja accout but I wasnt able to run it.
After reboot machine diapered from mag_ja VirtualBox VMs directory.
Is

mount -o bind

only temporary?

Offline

#7 2021-01-23 21:06:28

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,624

Re: [SOLVED] Access directory placed in another directory without permiss

Every mount is "temporary" (transient) - you'll have to add an entry to /etc/fstab (the order is important! if there's a mount for /home, put the bind mount below that line)
https://wiki.archlinux.org/index.php/Fstab

Online

Board footer

Powered by FluxBB