Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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 at 1:34

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

add comment

3 Answers 3

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
add comment

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
add comment

You could boot into single user mode, mount the filesystems mount -a and set/change the root password passwd

in linux booting into single user mode could be achieved by setting --init=/usr/bin/bash as a kernel option.

share|improve this answer
add comment

Your Answer

 
discard

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