Jump to content

Photo

[Solved] Root lost after adding user to group

root su sudo vboxsf virtualbox login

Best Answer Charles@Bodhi, 28 November 2015 - 03:20 PM

The default groups the original user should be member of is like below:

 id
uid=1000(name) gid=1000(name) groups=1000(name),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),109(lpadmin),110(sambashare)

The only way I can imagine what happened is that you omitted the "-a" option which should have resulted in adding vboxsf to the existing groups. If only "-G" option is used you have made the user member of the vboxsf group while removing all other groups.

 

Try Randy's suggestion to give you sudo-rights again first.

If that does not work you might need to use chroot to get access to your installed system and change system files using the appropriate commands.

 

Anyway, once you have access you need to restore all other group memberships too.

 

Since this is a virtual machine you might consider re-installing it of course. Since you are member of the vboxsf group you must be able to store important work to a shared folder outside the installation.

 

Enjoy,

Charles.

 

Edit: Oops, writing this before reading your last post.

Go to the full post


  • Please log in to reply
11 replies to this topic

#1 Suncatcher

Suncatcher

    Member

  • Members
  • 69 posts

Posted 24 November 2015 - 01:36 PM

Hi guys!

I am running Bodhi on VirtualBox and thus need user to be added to group "vboxsf". This is essential for proper functioning of shared folders feature. I used following command for this.

usermod -a -G vboxsf <username>

All went fine and I got shared folders after this. Surprisingly, I cannot login as root anymore.

I got "there is no record in "/bin/sh" or something like this. What am I doing wrong?

 

P.S. Why going root is so unusual in Bodhi? Previously in Arch (as well as in most widespread distros) I simply entered "su" and voila! And in Bodhi I should enter "sudo su". Is this normal?





A big thank you to everyone who contributes to Bodhi Linux


#2 Jeff

Jeff

    Lead Developer

  • Developer
  • 12493 posts
  • LocationBloomington, IL

Posted 24 November 2015 - 01:43 PM

Bodhi is based on Ubuntu which utilizes sudo as opposed to root accounts as it is commonly considered more secure. You can still log into a root session as you mentioned with sudo su.

 

Welcome to the boards.



#3 Suncatcher

Suncatcher

    Member

  • Members
  • 69 posts

Posted 26 November 2015 - 05:41 PM

You can still log into a root session as you mentioned with sudo su.

No, I cannot. Neither via display manager, nor via terminal.

 

screen.jpg



#4 Jeff

Jeff

    Lead Developer

  • Developer
  • 12493 posts
  • LocationBloomington, IL

Posted 26 November 2015 - 06:07 PM

Try:

 

sudo -i

 

Is your user able to launch other commands via the sudo command?



#5 Charles@Bodhi

Charles@Bodhi

    Old Faithful

  • Moderators
  • 4560 posts
  • LocationZeist, The Netherlands

Posted 26 November 2015 - 07:30 PM

Can you provide the outcome of 

cat /etc/group
id

Might help in finding a cause.

 

Is suncatcher the original user, created during the installation?

 

Enjoy,

Charles.



#6 Suncatcher

Suncatcher

    Member

  • Members
  • 69 posts

Posted 28 November 2015 - 10:26 AM

Try:

 

The same result as sudo su.

 

Is your user able to launch other commands via the sudo command?

 

No. The same message.



#7 Suncatcher

Suncatcher

    Member

  • Members
  • 69 posts

Posted 28 November 2015 - 10:30 AM

Can you provide the outcome of 

 

Yes. For cat /etc/group

root:x:0:
daemon:x:1:
bin:x:2:
sys:x:3:
adm:x:4:syslog
tty:x:5:
disk:x:6:
lp:x:7:
mail:x:8:
news:x:9:
uucp:x:10:
man:x:12:
proxy:x:13:
kmem:x:15:
dialout:x:20:
fax:x:21:
voice:x:22:
cdrom:x:24:
floppy:x:25:
tape:x:26:
sudo:x:27:
audio:x:29:pulse
dip:x:30:
www-data:x:33:
backup:x:34:
operator:x:37:
list:x:38:
irc:x:39:
src:x:40:
gnats:x:41:
shadow:x:42:
utmp:x:43:
video:x:44:
sasl:x:45:
plugdev:x:46:
staff:x:50:
games:x:60:
users:x:100:
libuuid:x:101:
netdev:x:102:
crontab:x:103:
syslog:x:104:
messagebus:x:105:
fuse:x:106:
mlocate:x:107:
ssh:x:108:
lpadmin:x:109:
sambashare:x:110:
avahi:x:111:
scanner:x:112:
lightdm:x:113:
nopasswdlogin:x:114:
bluetooth:x:115:
colord:x:116:
pulse:x:117:
pulse-access:x:118:
rtkit:x:119:
vboxsf:x:120:suncatcher
nogroup:x:65534:
suncatcher:x:1000:

For id

uid=1000(suncatcher) gid=1000(suncatcher) groups=1000(suncatcher),120(vboxsf)

Is suncatcher the original user, created during the installation?

 

Yes.



#8 Randy

Randy

    Bodhi-Care

  • Members
  • 646 posts
  • LocationFort Wayne, IN USA

Posted 28 November 2015 - 02:28 PM

Here is a hack that might work.  Boot a live cd which has a file manager which can gain sudo. Navigate to your hard drive install, then to /etc and open "group" in a text editor and add your user name to the "sudo" line.

 

Then reboot and see if it works.


Randy Fry



Linux Addict!

#9 Suncatcher

Suncatcher

    Member

  • Members
  • 69 posts

Posted 28 November 2015 - 03:02 PM

Here is a hack that might work.  Boot a live cd which has a file manager which can gain sudo. Navigate to your hard drive install, then to /etc and open "group" in a text editor and add your user name to the "sudo" line.

 

Then reboot and see if it works.

 

Thanks, that helped me to be root in terminal. However the trick didn't enable power buttons. How can I fix this?

 

Virtual_Box_Bodhi_28_11_2015_17_53_12.pn

 

And anyway it would be useful to detect cause of this issue in order to prevent such things further.



#10 Charles@Bodhi

Charles@Bodhi

    Old Faithful

  • Moderators
  • 4560 posts
  • LocationZeist, The Netherlands

Posted 28 November 2015 - 03:20 PM   Best Answer

The default groups the original user should be member of is like below:

 id
uid=1000(name) gid=1000(name) groups=1000(name),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),109(lpadmin),110(sambashare)

The only way I can imagine what happened is that you omitted the "-a" option which should have resulted in adding vboxsf to the existing groups. If only "-G" option is used you have made the user member of the vboxsf group while removing all other groups.

 

Try Randy's suggestion to give you sudo-rights again first.

If that does not work you might need to use chroot to get access to your installed system and change system files using the appropriate commands.

 

Anyway, once you have access you need to restore all other group memberships too.

 

Since this is a virtual machine you might consider re-installing it of course. Since you are member of the vboxsf group you must be able to store important work to a shared folder outside the installation.

 

Enjoy,

Charles.

 

Edit: Oops, writing this before reading your last post.



#11 Suncatcher

Suncatcher

    Member

  • Members
  • 69 posts

Posted 28 November 2015 - 04:18 PM

Thanks for the list of groups. The problem gone after adding them all. Topic can be closed.



#12 ylee

ylee

    King of the Software Page

  • Moderators
  • 1574 posts
  • LocationSouth Carolina, USA

Posted 28 November 2015 - 05:46 PM

Thanks for the list of groups. The problem gone after adding them all. Topic can be closed.

 

I marked it as solved for you and selected Charles answer above as the solution. Peace


"No technology can ever be too arcane or complicated for the black t-shirt crowd."






Also tagged with one or more of these keywords: root, su, sudo, vboxsf, virtualbox, login

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users