Page MenuHomeVyOS Platform

Bash history file does not exists after reboot and ony other file in home directory
Closed, ResolvedPublicBUG

Description

It seems /home/vyos directory is recreated after reboot

vyos@r14:~$ ls -la 
total 32
drwxr-xr-x 3 vyos users     4096 Jul 17 14:00 .
drwxr-xr-x 1 root root      4096 Jul 17 10:15 ..
-rw------- 1 vyos users      255 Jul 17 14:01 .bash_history
-rw-r--r-- 1 vyos users      220 Apr 24 00:23 .bash_logout
-rw-r--r-- 1 vyos users     4072 Jan 11  2021 .bashrc
-rw------- 1 vyos vyattacfg   20 Jul 17 13:01 .lesshst
-rw-r--r-- 1 vyos users      675 Jan 11  2021 .profile
drwxr-xr-x 2 vyos users     4096 Jul 17 10:15 .ssh
-rw-r--r-- 1 vyos vyattacfg    0 Jul 17 13:01 .sudo_as_admin_successful
vyos@r14:~$

It is caused after reboot we don't have the file .bash_history

vyos@r14:~$ ls -la
total 24
drwxr-xr-x 3 vyos users 4096 Jul 17 14:02 .
drwxr-xr-x 1 root root  4096 Jul 17 14:02 ..
-rw-r--r-- 1 vyos users  220 Apr 24 00:23 .bash_logout
-rw-r--r-- 1 vyos users 4072 Jan 11  2021 .bashrc
-rw-r--r-- 1 vyos users  675 Jan 11  2021 .profile
drwxr-xr-x 2 vyos users 4096 Jul 17 14:02 .ssh
vyos@r14:~$

Not really the bug but before we have this file between reboots

Update, it deletes all files, not only history

vyos@r14:~$ ls -l
total 0
-rw-r--r-- 1 root root 0 Jul 19 19:18 temp01
-rw-r--r-- 1 root root 0 Jul 19 19:18 temp02
-rw-r--r-- 1 root root 0 Jul 19 19:18 temp03
vyos@r14:~$ 
vyos@r14:~$ reboot now
Warning: there are unsaved configuration changes!
Run 'save' command if you do not want to lose those changes after reboot/shutdown.

Broadcast message from root@r14 on pts/1 (Wed 2023-07-19 19:19:07 EEST):

The system will reboot now!

Connection to 192.168.122.14 closed by remote host.
Connection to 192.168.122.14 closed.
sever@sever:~$

after reboot:

vyos@r14:~$ ls -l
total 0
vyos@r14:~$

Details

Difficulty level
Easy (less than an hour)
Version
VyOS 1.4-rolling-202307090317
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Perfectly compatible
Issue type
Bug (incorrect behavior)

Event Timeline

Dear Team
Earlier Bash history was retained after restart.It is useful feature as any changes done are lost after restart. Need
help on restoring this functionality.
Regards,
Vishvas

Viacheslav renamed this task from Bash history file does not exists after reboot to Bash history file does not exists after reboot and ony other file in home directory.Jul 19 2023, 4:24 PM
Viacheslav updated the task description. (Show Details)

I think this should be configured through a config option if bash-history should be retained or not (by default it shouldnt for regular users and equal to root).

It can for security reasons be argued that history should only exist in current session but when user logs out it should be removed.

This way in a multiuser environment one user cannot steal potential sensitive data from another user.

If security logging (what a particular user have done to the system when logged in) is needed this should be done remotely through syslog or similar.

Dear Viacheslav
Can I get compiled binary suitable for dell VEP4600 wich will retain the bash history.

I think this should be configured through a config option if bash-history should be retained or not (by default it shouldnt for regular users and equal to root).

It can for security reasons be argued that history should only exist in current session but when user logs out it should be removed.

This way in a multiuser environment one user cannot steal potential sensitive data from another user.

If security logging (what a particular user have done to the system when logged in) is needed this should be done remotely through syslog or similar.

@Apachez The bug is not only with history as a directory is completely deleted with all files in /home user directory after reboot

Oh ok.

I would still think thats a good thing if /config is the only part which is persistent between reboots.

c-po claimed this task.
c-po triaged this task as High priority.
c-po changed Difficulty level from Unknown (require assessment) to Easy (less than an hour).
c-po changed Is it a breaking change? from Unspecified (possibly destroys the router) to Perfectly compatible.
c-po changed Issue type from Improvement (missing useful functionality) to Bug (incorrect behavior).

Thank you c-po. When we will get the binary?
Regards,
Vishvas