7

I am running a Ubuntu 16.04 as a guest for a Windows 7 host.

I shared a folder inside Windows and I should be able to see and open the file inside the Linux.

The issue was me, as root, could not open the file because the root is not in the vboxsf group.

From this post, I just ran this command:

$ usermod -G vboxsf rootusername

After that I have lost the root privileges. I cannot use sudo su command, not open root files etc.

So how can I add the rootUser to vboxsf without losing all admin privileges?

1
  • 2
    What do you mean by rootusername? Root's username is root. Did you change the group for your account which you used to run sudo (presumably through the sudoers group membership)?
    – techraf
    Aug 12, 2016 at 4:19

2 Answers 2

9

To add a particular user to a particular group use:

sudo usermod -a -G groupname username

Here a is very important because otherwise the user will be removed from all other groups

Your problem is probably because you missed the -a part in your command

2
  • 2
    It should probably also be mentioned that modifying root's permissions or extending them is highly unadvisable in production environments.
    – Matt O.
    Aug 12, 2016 at 4:55
  • Yes, that solved the problem (-aG). It is only in a test environment to grab some files from windows.
    – IgorAlves
    Aug 12, 2016 at 13:08
5

You can add any user to any group by typing:

sudo gpasswd -a username groupname

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .