Thursday, December 10, 2009

FreeBSD - enable su for users.

While tinkering with freeBSD it convinced of its abilities qualifing as development box. Well at home FreeBSD runs over Fedora (in VirtualBox - Bridged Networking mode) and i can ssh to it both from desktop and laptop. But its really a wonder that FreeBSD denies root access remotely (aka. ssh). One easy and rather non-acceptable way is to allow root to login ( enter PermitRootLogin in /etc/ssh/sshd_config ), but it breaks the whole secure feature of FreeBSD.
The optimim way is to add a user to do 'su' which later can be used to remote login.

Steps to add user to root group (wheel).
# pw user mod -G wheel
# groups

For new users just add it to wheel along with default group while doing adduser.


Next you can allow su for all users.
Follow these steps.
# vi /etc/pam.d/su

and look for
'auth requisite pam_wheel.so no_warn auth_as_self noroot_ok exempt_if_empty' and comment it.

Happy sshing. "_"

No comments: