Many commands accepts username and passwords on the command line and ps, top, sockstat and many commands can display this information to all users on the system. How do I prevent users from seeing information about processes that are being run under another UID to avoid information leakage under FreeBSD operating systems?

FreeBSD has inbuilt security measure to disallow users to see processes run by other users (UID) to avoid information leakage (snooping). The MIB security.bsd.see_other_uids and security.bsd.see_other_gids needs to set to zero (0) to enable this security feature via sysctl. Type the following command to enable this feature on boot:
# echo 'security.bsd.see_other_uids=0' >> /etc/sysctl.conf
# echo 'security.bsd.see_other_gids=0' >> /etc/sysctl.conf

Type the following to turn it on immediately, enter:
# sysctl security.bsd.see_other_uids=0
# sysctl security.bsd.see_other_gids=0

Now normal users cannot see what other people or groups are running on the system. This also applies to all jailed systems.

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 9 comments so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersncdu pydf
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
9 comments… add one
  • Shoaibi May 26, 2009 @ 10:51

    Great.. I use FreeBSD server at my office and was looking for something like this.

  • Tapas Mallick May 26, 2009 @ 10:56

    is it possible to implement same feature in RHEL/CentOS ?

  • Mike May 26, 2009 @ 11:03

    ItΒ΄s not a BSD only feature. You will find the same feature in Caos Linux.

  • Tapas Mallick May 26, 2009 @ 12:34

    Will you please let me know exact procedure/web link to get the information..Thanks in Advance.

  • 🐧 nixCraft May 26, 2009 @ 12:48

    It is not part of standard Linux kernel. You need GRSecurity patch for Linux kernel (which is included with Caos Linux). Go to and download patch. You need to recompile the kernel. Alternatively, downloaded prebuilt rpms for CentOS / RHEL below:

  • Tapas Mallick May 28, 2009 @ 4:00

    Hi Vivek,

    I have downloaded latest .rpm and installed the same on my test CentOS 5.3(i386) system. Will you please let me me what to do next to get the expected functionality ? Thanks.

  • warren Jun 3, 2009 @ 12:43

    This should be saying:

    # echo ‘security.bsd.see_other_uids=0’ >> /etc/sysctl.conf
    # echo ‘security.bsd.see_other_gids=0’ >> /etc/sysctl.conf

    and not /etc/rc.conf

  • 🐧 nixCraft Jun 3, 2009 @ 14:40

    @ warren
    Thanks for the heads-up!

  • kapil Jun 29, 2011 @ 4:41

    can you plz let me know how to make this configuration in Redhat Linux 5.

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum