debian – Dan Vasile https://pentest.ro InfoSec Adventures Thu, 10 Dec 2020 11:11:22 +0000 en-US hourly 1 https://wordpress.org/?v=6.2.2 Webmin and Virtualmin installation on Debian https://pentest.ro/2012/01/28/webmin-and-virtualmin-installation-on-debian/ Fri, 27 Jan 2012 22:33:52 +0000 http://www.pentest.ro/?p=276 Continue reading Webmin and Virtualmin installation on Debian]]> Now that we have a fresh and clean Debian installation we can proceed to Webmin and Virtualmin installation.

Althou installing Apache, MySQL and other stuff needed for a web server by hand is not hard and you can find a lot of support I prefer installing Webmin and Virtualmin to ease the administrative tasks.

If you’re planning for a new server you should start with a fresh Debian installation with only the basic stuff on it.

Fast Debian installation of Webmin:

# wget http://www.webmin.com/download/deb/webmin-current.deb
# dpkg --install webmin-current.deb

You probably will miss some dependencies and will have to install them via ‘apt-get install‘. On my fresh Debian I was missing some perl modules so I did ‘apt-get install perl’, again dependecies missing, but with a ‘apt-get install -f‘ (as instructed) I solved it.

When this process is over you can login at https://server_ip:10000. Most browsers will issue a warning because the certificate is not signed by a trusted 3rd party, but that’s fine since it’s your machine. If you login as root you will have full control of the system but pay attention to what you do from that point on.

Now a quick installation of Virtualmin:

# wget http://software.virtualmin.com/gpl/scripts/install.sh
# chmod +x install.sh
# ./install.sh

It askes for a FQDN, if you’re planning on a web hosting server you should provide your domain name (the hosting company domain) as this will be used as default when something is not found or when someone requests the IP directly via http.

Now the cool magic part comes in, as the install script does pretty much everything you should have done by hand, installing apache, mysql, php and a whole lot more (it will take a while).
A Post-Installation Wizard is now in place at https://server_ip:10000 to guide you in configuring Virtualmin. There are performance issues that can be change later on and since you will be exploring a first installation of Webmin & Virtualmin, the default values are just fine. As a side note to this, if you’re not planning  an email server you should disable clamav and SpamAssassin for saving RAM. By default MySQL will be the database and PostgreSQL will not be running. You will be prompted for a MySQL password (which should be different as the root password for obvious security reasons). You will be asked how should the passwords be stored, I higly recomend storing them as hashed. When they are stored as plaintext you can easily recover them for fast-forgeting users but this raises high security issues. You can always reset the passwords for your users.

Because we configured our VM as bridged network, we can access it not from only the host machine, but from the entire network, making it a playground for the office, or offering services such as internal web, file hosting, etc.

]]>
Install a clean Debian on Virtualbox https://pentest.ro/2012/01/27/install-a-clean-debian-on-virtualbox/ Fri, 27 Jan 2012 21:40:30 +0000 http://www.pentest.ro/?p=252 Continue reading Install a clean Debian on Virtualbox]]> I don’t test my ‘ideas’ on live servers, nor do I keep unnecessary hardware around the house to play with them. So I use the other option in hand, a virtual machine. Despite the fact that this will be a VM installation of Debian, the idea for a very clean and basic installation is the same for a real hardware installation.

For my testing purposes I prefer Oracle VM VirtualBox instead of VMWare. First of all because it’s free for home use and secondly it’s smaller and faster for the applications I run. If you don’t already have it installed you can download it from https://www.virtualbox.org/wiki/Downloads.

You might have noticed that I’m a Debian fan, these is the system I have worked for a long time so it’s more of a habit now. For our clean installation we’ll use the so called NetInstall version. It’s a small ISO image (under 200MB), containing only the basics for the installation, the rest of the applications will be downloaded during the install phase. So you must have internet access during installation (if you read this article you surely do, but pay attention when installing on real hardware). So, download the latest version of Debian NetInstall from http://www.debian.org/CD/netinst/.

Start VirtualBox and let’s create a new Virtual Machine, by selecting New:

New Virtual Machine
New Virtual Machine

Next we select a Name and the type of the OS:

Selecting the name and type of the OS
Selecting the name and type of the OS

Select how much RAM to give to the Virtual Machine. Note that if you assign more than half of your physical RAM to the VM like I’m doing in the image below you risk RAM starvation on the host machine, you should analyze  the situation depending on your hardware. Anyway, there is a base recommendation of at least 384MB RAM for a Debian. Depending on what you plan with this VM you should assign the RAM. Usually 1GB of RAM will be more than enough.

Assigning RAM to the VM
Assigning RAM to the VM

Now we’ll create a hard-drive for our VM.

Creating a new drive for the VM
Creating a new drive for the VM

Then we select the type of the disk, the format in which it will be stored on disk. If you plan to port this VM to VMWare you should choose VMDK, otherwise VDI which is the default VirtualBox format is fine.

VDI type for our virtual HDD
VDI type for our virtual HDD

We choose then how will the disk space will be allocated. If you choose Fixed Size, then all the space necessary will be locked by the file used to store the HDD. In Dynamically Allocated mode, the file is only as large as you have files stored on the VM, so it’s a better option in terms of managing resources efficiently.

Dynamically allocated disk
Dynamically allocated disk

As for the size of the disk you should know better. By default, VirtualBox is proposing 8GB. I know I need a little bit more space for my applications so I choose 16GB, you should do your math.

Disk size
Disk size

We’re done creating our machine, press Create two times and that’s it with this phase.

Creating the VM
Creating the VM

Let’s modify some important settings of our newly created VM.Press Settings from the main screen.

Settings
Settings

Go to Storage -> IDE Controller -> Empty, check  the Live CD/DVD check-box and select the ISO image of Debian downloaded earlier.

Mapping the ISO as the CD drive of the VM
Mapping the ISO as the CD drive of the VM

Under the Network tab, I choose a Bridged Network type to avoid yet another NA. In bridged mode, the network adapter on the VM is practically in the same network as the host machine. I bridged the adapter to my wireless network card which is the one connected to the Internet.

Networking - Bridged Adapter
Networking - Bridged Adapter

It’s time to start the machine.

START
START

If everything is fine the VM should boot from the ISO image of Debian NetInstall. Choose Install in the first screen.

Install
Install

You will the select the Language for the installation, Location -> Locales -> Keymap. If your network adapter is on DHCP then the installer will automatically detect the network and acquire a new IP address for the VM. Otherwise it will prompt to introduce manually the network settings. Next select a Hostname (debian is just fine) -> Domain name (be creative). You will then be prompted for a root password and to create a new user.

Partitioning for beginners is simple with Debian, just choose the defaults.

Guided Disk Partitioning
Guided Disk Partitioning
All files in one partition
All files in one partition

Confirm Finish partitioning and write to disk. The installer will load the base system then will ask for the mirror which will be used to download the rest of the necessary files. Choose the closest one to your location for faster download.

In the Software Selection screen uncheck all the packages except SSH. Remember, we want a clean install, everything needed will be installed after. So just the SSH daemon for access to the VM (it’s way better than the terminal).

Software Selection
Software Selection

Confirm Loading GRUB to MBR and finish the installation. There you have it, a fresh, clean Debian. Log in, type ifconfig and connect via SSH.

Shell
Shell
]]>