Debian 7.6 X86_64 Basic Config

by zzy809
14 deployments · 9 still active · last rev. 1 year ago

=============================================
This script follows the official Getting Started Guide on:
https://www.linode.com/docs/getting-started
=============================================

Include:
- Install Software Updates
- Set the Hostname
- Update /etc/hosts(FQDN)
======================
Optional setup, please do the following manually if you want
- Set the Timezone(graphic)
----command line: dpkg-reconfigure tzdata

- Check time(Optional)
----command line: date

- Add new user and Disable root login (https://www.linode.com/docs/security/securing-your-server/#disabling-ssh-password-authentication-and-root-login)

- Create a Firewall (https://www.linode.com/docs/security/securing-your-server/#creating-a-firewall)

- Install and Configuring Fail2Ban (may be out of date)

Compatible with: Debian 7
						#!/bin/bash
#<UDF name="hostname" label="The hostname for the new Linode.">
# HOSTNAME= 
# 
#<UDF name="fqdn" label="The new Linode's Fully Qualified Domain Name">
# FQDN=


# This sets the variable $IPADDR to the IP address the new Linode receives. 
IPADDR=$(/sbin/ifconfig eth0 | awk '/inet / { print $2 }' | sed 's/addr://')
     
# This updates the packages on the system from the distribution repositories. 
apt-get update 
apt-get upgrade -y
   
# This section sets the hostname. 
echo $HOSTNAME > /etc/hostname 
hostname -F /etc/hostname
      
# This section sets the Fully Qualified Domain Name (FQDN) in the hosts file. 
echo $IPADDR $FQDN $HOSTNAME >> /etc/hosts