How do I hide a script in Linux?

How do I hide a script in Linux?

To hide a file or directory from the terminal, simply append a dot . at the start of its name as follows using the mv command. Using GUI method, the same idea applies here, just rename the file by adding a .

How do I mask a process in Linux?

5+ above) you can hide process from other users. Only root can see all process and user only see their own process. All you have to do is remount the /proc filesystem with the Linux kernel hardening hidepid option. This hides process from all other commands such as ps, top, htop, pgrep and more.

Where is the .swap file in Linux?

To see swap size in Linux, type the command: swapon -s . You can also refer to the /proc/swaps file to see swap areas in use on Linux. Type free -m to see both your ram and your swap space usage in Linux. Finally, one can use the top or htop command to look for swap space Utilization on Linux too.

How can I hide processes in a directory?

If you’ve ever run ls /proc, you noticed that there is a subdirectory for every running process in the system, and each directory is named after the PID of the process itself. So, ps will just grab the list from getdents (), and then iterate over a fixed set of files in each subdirectory.

How to hide the secret of a program in Bash?

In the last case your program will be launched like myCommand /dev/fd/67, where the contents of /dev/fd/67 is your secret ( hello-neo in this example). In all of the above approaches, be wary of leaving the command in bash command history ( ~/.bash_history ).

How to hide a command line parameter in Bash?

You could try encrypting the secret and have the command decrypt it before use. You can use LD_PRELOAD to have a library manipulate the command line arguments of some binary within the process of that binary itself, where ps does not pick it up. See this answer of mine on Server Fault for details.

How to avoid leaving Bash command in history?

In all of the above approaches, be wary of leaving the command in bash command history ( ~/.bash_history ). You can avoid this by either running the command from a script (file), or by interactively prompting yourself for password each time: