Why in Tails the history of the entered commands is not saved. How to make so that the history of the last Bash commands are saved
The history of commands that you entered and performed earlier is very convenient, since by pressing ↑ (the up arrow key) you can reduce the time to perform a single-type operation. Also, if you make a mistake, you can return to the previous command and correct it – no need to retype a long command.
The list of the last commands is stored in the .bash_history file, which is located in the user's home folder. In regular Linux distributions, this file is saved after a reboot and, for example, the next day you can open the console and find the command you entered yesterday and execute it again, without having to type a lot of characters and remember the options. In Tails, this does not work – after a reboot, the .bash_history file is reset and commands are available only for the current session.
In this guide it will be shown how to make the .bash_history file saved after a reboot, that is, to keep the command history. But you have to assess how much this may affect security: for example, if attackers were able to take control of your system and pick up the password from the permanent storage, then they will be able to see which commands you entered. If you do not want this, then do not enable saving commands – leave the default settings.
So, if you do decide, you need to do three things:
2. In the persistent storage enable Dotfile support
3. Create a .bash_history file in the /lib/live/mount/persistence/TailsData_unlocked/dotfiles/ folder. This file can be simply copied from the home folder. You can do this in the file manager or directly on the command line:
cp ~/.bash_history /lib/live/mount/persistence/TailsData_unlocked/dotfiles/
Commands entered into the current session will not be saved. This function will start working after the computer is restarted and will be active only when persistent storage is enabled.
Related articles:
- How to install Tails on (internal or external) hard disk. How to install Tails in VirtualBox (70.4%)
- How to install and use VeraCrypt in Tails (70.4%)
- How to configure programs to access the Internet in Tails. Internet connection settings for command line utilities (70.4%)
- How to upgrade Tails on an internal HDD (70.4%)
- How to save and open website pages in Tails in a web browser (70.4%)
- How to install driver for Wi-Fi for adapters with RTL8814AU chipset (Alfa AWUS1900) (RANDOM - 11.2%)