By default, on FreeBSD, users can see information about processes owned by other users by running the ps
command. However, you can prevent users from seeing this information by enabling the security.bsd.see_other_uids
sysctl option.
Here are the steps to prevent users from seeing information about processes owned by other users on FreeBSD:
- Log in as the root user or switch to the root user using the
su
command. - Type the following command to enable the
security.bsd.see_other_uids
sysctl option:
sysctl security.bsd.see_other_uids=0
This command sets the value of the security.bsd.see_other_uids
option to 0
, which disables the ability of non-root users to see information about processes owned by other users.
- To make this change permanent, you will need to add the following line to the
/etc/sysctl.conf
file:
security.bsd.see_other_uids=0
This will ensure that the security.bsd.see_other_uids
option is set to 0
every time the system boots up.
- Save and close the
/etc/sysctl.conf
file.
That’s it! You have prevented users from seeing information about processes owned by other users on FreeBSD by enabling the security.bsd.see_other_uids
sysctl option. Note that this will affect all users on the system except for the root user.