Skip to content

Instantly share code, notes, and snippets.

@LBeckX
Last active July 31, 2021 15:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LBeckX/548f4f42c5f63d93c75452658a2e1d28 to your computer and use it in GitHub Desktop.
Save LBeckX/548f4f42c5f63d93c75452658a2e1d28 to your computer and use it in GitHub Desktop.
VirtualBox Clone Ubuntu20
#!/bin/sh
apt update
apt upgrade
apt install net-tools
apt install network-manager
########################
# Change hostname
########################
# hostnamectl set-hostname 'hostname'
# vi /etc/hosts # And change the hostname
########################
# Reset network // Think of to give new MAC-Address
# And always use nat-network btw. enable port-forwarding from 127.0.0.1:PORTX to VM_IP:ExecutionPort
# Example SSH: Host IP: 127.0.0.1, Host Port: 2201, VM IP: 10.2.0.15, VM Port: 22
# Uncomment to reset VM ID
########################
#rm -rf /etc/machine-id
#dbus-uuidgen --ensure=/etc/machine-id
#init 6
########################
# Init ssh key
########################
# ssh-keygen
########################
# Copy ssh-key to cluster machine
########################
# ssh-copy-id -i ~/.ssh/id_rsa_XXX USER@IP
########################
# Disable ssh rootlogin
# Move to file /etc/ssh/sshd_config
# Set PermitRootLogin no
########################
#########################
# Allow SSH only for group
#########################
# sudo groupadd sshusers
# sudo usermod -a -G sshusers USER
# sudo echo "AllowGroups sshusers" >> /etc/ssh/sshd_config
##########################################################
# More information about to make linux secure https://github.com/imthenachoman/How-To-Secure-A-Linux-Server#installing-linux
##########################################################
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment