Tag Archives: linux

Linux: Hide Processes from Other Users

unix linux

If you are into Linux OS hardening, then one of the ways to improve security is to hide the display of running processes and their arguments from other users. This feature is available if you are on a Linux kernel version of 3.2 or above that supports the new hidepid mount option for procfs or /proc filesystem.

UNIX / Linux: File Permissions in Octal

unix linux

To set file permissions using the chmod command, we can specify the permissions in either numeric mode or symbolic mode. But when we want to get the file permissions, most often with the ls -l command, we are normally only given a printout using the symbolic mode.

Extract WhatsApp Password on Android

WhatsApp uses a customised version of XMPP (Extensible Messaging and Presence Protocol) as the communication protocol. Upon installation, it creates a user account using one’s phone number (with country code prefix) as the username (Jabber ID: [phone number]@s.whatsapp.net). A password is generated using an unknown algorithm on the server end and sent to the client. Previously the password was derived from the phone’s IMEI or the WiFi MAC address.

UNIX / Linux: Delete Files Older Than x Days

unix linux

To delete files that are older than x days, we first find them using the find command. Next, to delete the files, we use the execute action of the find command and pass down the list of files to be deleted to the rm command.

How to Debug a Shell Script

shell script

One of the most common questions asked by a new sysadmin or UNIX user is: How to debug a shell script?

Netstat Tips and Tricks

unix linux

The netstat command prints information about the UNIX and Linux networking subsystem such as the network connections, routing tables, masquerade connections, multicast memberships plus many more.

In this article, let’s review some of the netstat tips and tricks.

Unix / Linux: How to Print Shared Library Dependencies

unix linux

Almost all programs on UNIX and/or Linux use shared libraries. Only some programs, like the root shell, /sbin/sh, on old versions of Solaris, used to be statically linked. It is no longer the case for the current Solaris releases. It was mainly due to historical reasons when disks used to be small in size (usually 128MB or less in size) and the shared libraries in /usr/lib were mounted from a second disk or NFS server. If you boot a server into single-user mode, it may not mount partitions other than the root partition, thereby breaking any dynamically linked program.

How to Sleep in Shell Script

shell script

Sometimes you will need to pause execution for a specific period within a shell script. To do that, you will need to use the sleep command to delay for a specified amount of time in seconds, minutes, hours or days.