Create template from a vm: Difference between revisions

From Jwiki
No edit summary
No edit summary
Line 6: Line 6:
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
sudo su - root
sudo su - root
echo "" > ~/.bash_history
rm ~/.Xauthority
rm ~/.Xauthority
echo "" > ~/.bash_history
rm /etc/ssh/ssh_host_*
rm /etc/ssh/ssh_host_*
echo "" > /etc/machine-id
echo "" > /etc/machine-id
Line 22: Line 22:


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
echo "" > ~/.bash_history
rm ~/.Xauthority
rm ~/.Xauthority
echo "" > ~/.bash_history
history -c
history -c
sudo shutdown  
sudo shutdown  
</syntaxhighlight>
</syntaxhighlight>

Revision as of 10:08, 29 August 2024


1. Execute as root:

sudo su - root
echo "" > ~/.bash_history
rm ~/.Xauthority
rm /etc/ssh/ssh_host_*
echo "" > /etc/machine-id
systemctl disable --now salt-minion.service
echo
rm -rf /etc/salt/pki/minion/*
echo "" > /etc/salt/minion_id
echo "" > /etc/resolv.conf
history -c
exit

1. Execute as other user (optional):

echo "" > ~/.bash_history
rm ~/.Xauthority
history -c
sudo shutdown