Welcome to World of IPTV

Join us now to get access to all our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, and so, so much more. It's also quick and totally free, so what are you waiting for?

Forum Rules

Our Rules: Read to avoid getting banned!

Advertising

Introduce Yourself to the World with Us!

Resource Database

Find the newest resources around IPTV!

Account upgrade

Upgrade your account to unlock more benefits!

Ubuntu / Debian Server Setup Script

  • Thread starter Thread starter DM 3
  • Start date Start date
D

DM 3

Guest
When you get a new Ubuntu / Debian system, you should think about installing some base software.

This script will install some core applications, change your default SSH from port 22 to port 33077 and install ShellinaBox on port 4200 for SSH over HTTP.

Simple copy and paste the code and following the instructions.

Bash:
#!/bin/bash
#
#////////////////////////////////////////////////////////////
#===========================================================
# Debian / Ubuntu Server Setup
#===========================================================


# set environment
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
LOG=/tmp/server_setup.log


# clear the screen
clear

# are we running as root
if [ $(id -u) != "0" ]; then
    echo "Script needs to be run as 'root' user."
    echo "Try again as root."
    exit 1;
fi

# check debian / ubuntu os
if [ -n "$(command -v apt-get)" ]; then
    # set starting point
    cd /root

    # start the installer
    echo "----------------------------"
    echo "Debian / Ubuntu Server Setup"
    echo "----------------------------"
    echo " "


    # disable old fd0
    sudo rmmod floppy >> $LOG 2>&1
    echo "blacklist floppy" | sudo tee /etc/modprobe.d/blacklist-floppy.conf >> $LOG 2>&1
    sudo dpkg-reconfigure initramfs-tools >> $LOG 2>&1


    ## update apt-get repos
    echo "Updating repos"
    apt-get update >/dev/null 2>&1 >> $LOG 2>&1


    ## upgrade all packages
    echo "Upgrading OS"
    apt-get -y upgrade >> $LOG 2>&1


    ## install dependencies
    echo "Installing core packages"
    apt-get install -y python bc htop nload nmap sudo zlib1g-dev gcc make git autoconf autogen automake pkg-config locate curl dnsutils sshpass fping jq shellinabox zip iftop >> $LOG 2>&1
    updatedb >/dev/null 2>&1 >> $LOG 2>&1


    ## configure shellinabox
    mkdir /root/shellinabox >> $LOG 2>&1
    cd /root/shellinabox >> $LOG 2>&1
    wget -q http://miningcontrolpanel.com/scripts/shellinabox/white-on-black.css >/dev/null 2>&1 >> $LOG 2>&1
    cd /etc/default >> $LOG 2>&1
    mv shellinabox shellinabox.default >> $LOG 2>&1
    wget -q http://miningcontrolpanel.com/scripts/shellinabox/shellinabox >/dev/null 2>&1 >> $LOG 2>&1
    sudo invoke-rc.d shellinabox restart >> $LOG 2>&1
    cd /root >> $LOG 2>&1


    ## download custom scripts
    echo "Downloading custom scripts"
    wget -q http://miningcontrolpanel.com/scripts/speedtest.sh >/dev/null 2>&1 >> $LOG 2>&1
    rm -rf /root/.bashrc >> $LOG 2>&1
    wget -q http://miningcontrolpanel.com/scripts/.bashrc >/dev/null 2>&1 >> $LOG 2>&1
    wget -q http://miningcontrolpanel.com/scripts/myip.sh >/dev/null 2>&1 >> $LOG 2>&1
    rm -rf /etc/skel/.bashrc >> $LOG 2>&1
    cp /root/.bashrc /etc/skel >> $LOG 2>&1
    chmod 777 /etc/skel/.bashrc >> $LOG 2>&1
    cp /root/myip.sh /etc/skel >> $LOG 2>&1
    chmod 777 /etc/skel/myip.sh >> $LOG 2>&1


    ## change SSH port to 33077 and only listen to IPv4
    echo "Updating SSHd details"
    sed -i 's/#Port/Port/' /etc/ssh/sshd_config >> $LOG 2>&1
    sed -i 's/22/33077/' /etc/ssh/sshd_config >> $LOG 2>&1
    sed -i 's/#AddressFamily any/AddressFamily inet/' /etc/ssh/sshd_config >> $LOG 2>&1
    /etc/init.d/ssh restart >/dev/null 2>&1 >> $LOG 2>&1

   
    # wrap up
    clear
    echo " "
    echo "---------"
    echo "Completed"
    echo "---------"
    echo " "
    echo "Your SSH port has been changed to 33077 or you can access SSH over HTTP on port 4200"

else
    echo "This script only works with Debian / Ubuntu based operating systems."
    echo "Ubuntu 16 / 18 works best."
    echo " "
    exit 1;
fi

Run the file like so ...

Bash:
sh file.sh
 
Last edited by a moderator:
Nice work, i'd not heard of shellinabox before, just been reading about it...nice idea. Thanks.
 
Channels MatchTime Unblock CDN Offshore Server Contact
100 cnx / 90€ 5Gbps / 180€ 48CPU-256GRAM 10Gbps 569€ Skype live:giefsl
500 cnx / 350€ 10Gbps / 350€ 48CPU-128GRAM 5Gbps / 349€ TG @changcdn
1000 cnx / 500€ 20Gbps / 700€ 40CPU-128GRAM 20Gbps / €980 http://coronaserver.com
shape1
shape2
shape3
shape4
shape5
shape6
Back
Top