Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is this a trap? I made these steps in FreeBSD 10:

1) ssh as root prohibited

2) logged as user

3) su as root

4) as root chsh changed name of user "user" to "luser"

5) exit from root

And from this moment I can't su root cause the luser is not in the wheel group and I can't change group in /etc/group because I have no privileges for doing that.

What can I do to login as root ?

share|improve this question

migrated from serverfault.com Mar 7 '14 at 1:34

This question came from our site for system and network administrators.

You can do any one of these four things:

  • Log in as a user that is in the wheel group and fix it from there
  • Log in as root from the console/ILO
  • Boot off of a CD, mount /etc and fix /etc/group
  • Restore /etc/passwd and /etc/shadow from the most recent backup
share|improve this answer

You can boot from a live cd or usb drive, mount your system partition, modify the nessecary files, boot your system again.

share|improve this answer

There is no need for live cd or usb stick. You could boot into single user mode, mount the filesystems mount -a and set/change the root password passwd

In BSD booting into single user mode is usually an option in the boot menu.

In linux booting into single user mode could be achieved by setting --init=/usr/bin/bash as a kernel option. (e.g. in grub, select the boot line, press e to edit, change the init parameter, press c to continue booting.)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.