Sunday, June 7, 2015

How to Enable su root For a Normal User in FreeBSD


root@freebsd:~ # su - andre
When you've made modifications to a file in vi(1) and then find that
you can't write it, type ``<ESC>!rm -f %'' then ``:w!'' to force the
write

This won't work if you don't have write permissions to the directory
and probably won't be suitable if you're editing through a symbolic link.
$ su -
su: Sorry
$ exit
root@freebsd:~ # head /etc/group 
# $FreeBSD: releng/10.1/etc/group 256366 2013-10-12 06:08:18Z rpaulo $
#
wheel:*:0:root
daemon:*:1:
kmem:*:2:
sys:*:3:
tty:*:4:
operator:*:5:root
mail:*:6:
bin:*:7:
root@freebsd:~ # pw usermod andre -G wheel
root@freebsd:~ # head /etc/group
# $FreeBSD: releng/10.1/etc/group 256366 2013-10-12 06:08:18Z rpaulo $
#
wheel:*:0:root,andre
daemon:*:1:
kmem:*:2:
sys:*:3:
tty:*:4:
operator:*:5:root
mail:*:6:
bin:*:7:
root@freebsd:~ # su - andre
If you have a CD-ROM drive in your machine, you can make the CD-ROM that is
presently inserted available by typing 'mount /cdrom' as root.  The CD-ROM
will be available under /cdrom/.  Remember to do 'umount /cdrom' before
removing the CD-ROM (it will usually not be possible to remove the CD-ROM
without doing this.)

Note: This tip may not work in all configurations.
$ su -
Password:

root@freebsd:~ # 

0 comentários:

Post a Comment