Create template from a vm: Difference between revisions

From Jwiki
Created page with "<syntaxhighlight lang="bash"> sudo su - root rm /etc/ssh/ssh_host_* echo "" > /etc/machine-id echo "" > /root/.bash_history echo "" > /home/gyurci08/.bash_history 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 </syntaxhighlight> <syntaxhighlight lang="bash"> rm ~/.Xauthority echo "" > ~/.bash_history history -c sudo shutdown </syntaxhighlight>"
 
No edit summary
Line 1: Line 1:
1. Execute as root:
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
sudo su - root
sudo su - root
Line 13: Line 18:
exit
exit
</syntaxhighlight>
</syntaxhighlight>
1. Execute as other user (optional):


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">

Revision as of 10:06, 29 August 2024


1. Execute as root:

sudo su - root
rm /etc/ssh/ssh_host_*
echo "" > /etc/machine-id
echo "" > /root/.bash_history
echo "" > /home/gyurci08/.bash_history
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):

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