How does FreeBSD modify the root password?
Resetting the root password is actually easy.
Step 1: Restart the FreeBSD server. When the mode is selected, select 2 (Boot single user) in single user mode)
650) this. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/4D/DD/wKioL1RbSB_gMFiqAACnwjJMRuU510.jpg "title =" Image 1.png "alt =" wkiol1rbsb_gmfiqaacnwjmruu510.jpg "/>
The system prompts you to press enter to continue.
650) this. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/4D/DE/wKiom1RbR8iDF_ijAADper_zCD4597.jpg "title =" Image 2.png "alt =" wKiom1RbR8iDF_ijAADper_zCD4597.jpg "/>
Step 2: Enter fsck-y (check the system file because the system file will be repaired and asked if it is repaired. Therefore, the-y parameter must be added to indicate that the default value is yes .) After the disk check is complete, mount all system partitions
650) this. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/4D/DD/wKioL1RbSDXBuuC6AACnI5vOpAg920.jpg "title =" Image 3.png "alt =" wKioL1RbSDXBuuC6AACnI5vOpAg920.jpg "/>
Step 3: enter mount-a (-a to load all the devices set in the/etc/fstab file)
Step 4: reset the root user password, enter passwd, and press Enter. You will be prompted to enter the password again. After confirmation, press Ctrl + D to start the system.
How does FreeBSD switch from a common user to a root user?
In FreeBSD, connect to FreeBSD through the ssh client, log on with a common user, and run the following command to report an error ......
In FreeBSD, connect to FreeBSD through the ssh client and log on with a common user. Run the following command to report an error:
$ Su-root
Su: sorry
Log on from the terminal as a root user, modify the/etc/group file, and add a common user to the wheel group. After the addition, use the su command on FreeBSD to switch to the root user, by default, switchover is not possible because FreeBSD imposes stricter restrictions on the users who execute the su command, the user who can use the su command must belong to the wheel group (the root basic group, the group ID is 0). Otherwise, the user cannot use this command to become the root user. Therefore, you need to edit the group settings file/etc/group and add the management members that require superuser power to the wheel group.
Freebsd # vi/etc/group
Wheel: *: 0: root. Note that the root and user are separated by commas (,).
Daemon: *: 1:
Kmem: *: 2:
...
: Wq
Log on to the root user through SSH. Save and exit. Do not restart!
How does freebsd configure SSH logon for root users?
Modify the/etc/ssh/sshd_config file
Find the PermitRootLogin line, cancel the # comment,
Change to PermitRootLogin yes
Restart sshd.
Service sshd restart
You can.
Solution to newly installed FreeBSD server problems