FreeBSD tips'n'tricks

Preventing users to see all running processes by 'ps' that are being run under another UID:
sysctl security.bsd.see_other_uids=0
sysctl security.bsd.see_other_gids=0



Mounting/Unmounting the CD/DVD-ROM drive
(by default FreeBSD upon cd/dvd installation will automatically install the drive and make it mountable)

mount /cdrom
umount /cdrom



Want to eject the CD/DVD-ROM drive in FreeBSD?
(firstly you must know witch filesystem is the drive: df -h)
cdcontrol -f /dev/acd0 eject

Getting detailed process information on Freebsd
procstat -a

See how many interrupts taken by each device:
vmstat -i

lsof alternatives for FreeBSD:
fstat tells you which user,command and pid opened the file, which mount point the file is and information about the open file descriptor like read/write, inode number and mount point of the opened file.Please see man page of fstat for other options.

sockstat gives you information about the opened sockets like which process/command is using it, user of the process,pid,protocol like tcp/udp,stream,dgram,etc.. and connected ports of local and remote servers.

0 comentarii: