Difference between revisions of "Mini Debian"

From Da Nerd Mage Wiki
Jump to navigation Jump to search
 
(21 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{{!}} class="wikitable" style="float: right; width: 322px;" border="2"
{{!}}+ Proven on:
{{!}}- <!-- Debian -->
{{!}} style="text-align: center; width: 60px;" {{!}} [[File:Logo Debian.png{{!}}60px{{!}}link=https://www.debian.org/{{!}}center{{!}}middle{{!}}frameless]]
{{!}} style="text-align: center; width: 40px;" {{!}} 11 (bullseye)
{{!}} well... duh...
{{!}}}
So...
So...


Line 13: Line 21:


* Insert the [https://www.debian.org/download CD/ISO/whatever] & boot the machine/VM from it.
* Insert the [https://www.debian.org/download CD/ISO/whatever] & boot the machine/VM from it.
** I'm running it as VMs under ESXi
** <span style="text-decoration: line-through;" >I'm running it as VMs under ESXi</span>
*** "ESXi 6.7 VM", "Linux", "Debian GNU/Linux 10 (64-bit)"
*** <span style="text-decoration: line-through;" >"ESXi 6.7 VM", "Linux", "Debian GNU/Linux 10 (64-bit)"</span>
*** 4 CPUs, 4GB memory, 16GB storage
*** <span style="text-decoration: line-through;" >4 CPUs, 4GB memory, 16GB storage</span>
** These days, I'm running it as VMs under Proxmox
*** "Linux", "5.x - 2.6 Kernel"
***4 Cores, 4GB memory, 16GB storage
***Pretty much leaving everything else default...
* When the installer menu appears, select "'''Install'''" rather than the default "'''Graphical Install'''" option
* When the installer menu appears, select "'''Install'''" rather than the default "'''Graphical Install'''" option
* Cruze along configuring the system to your liking until you reach the screen titled "'''[!] Software selection'''"
* Cruze along configuring the system to your liking until you reach the screen titled "'''[!] Software selection'''"
Line 24: Line 36:


[[Linux - Mini Debian - Pictures{{!}}The sequence in pictures...]]
[[Linux - Mini Debian - Pictures{{!}}The sequence in pictures...]]
<span style="color: #169179;">Upon first boot up of your new system:</span>
* <code>sudo apt update</code>
* <code>sudo apt upgrade</code>
<span style="color: #169179;">(Because there're ALWAYS updates...)</span>


=Configuring the minimal Debian=
=Configuring the minimal Debian=
Line 37: Line 56:
#* <code>adduser '''USER''' sudo</code>
#* <code>adduser '''USER''' sudo</code>
# Log into the '''USER''' shell, and type the following command to verify that the user is authorised:
# Log into the '''USER''' shell, and type the following command to verify that the user is authorised:
#* <code>sudo -v</code>
#* <code>sudo -V</code>
You have successfully configured <code>sudo</code> in Debian.
You have successfully configured <code>sudo</code> in Debian.


==Install & configure '''vim'''==
== Install & configure '''vim''' ==


* <code>sudo apt install vim</code>
* <code>sudo apt install vim</code>
Then fix the '''Visual Mode''' silliness...
Then fix the '''Visual Mode''' silliness...


* <code>sudo vim ~/.vimrc</code>
* <code>vim ~/.vimrc</code>
 
  set mouse-=a
  set mouse-=a
  syntax on
  syntax on
Do the same for when you use it via sudo...
* <code>sudo vim /root/.vimrc</code>
== Set up a private '''bin''' directory ==
* <code>mkdir ~/bin</code>
& make it useable:
*<code>vi ~/.bashrc</code>
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi


==Aliases for ls==
==Aliases for ls==
Line 68: Line 100:
* <code>source ~/.bashrc</code>
* <code>source ~/.bashrc</code>


=More Configurations=
= More Configurations =
==Samba==
* [[Setting up NFS for file sharing{{!}}Setting up NFS for file sharing]]
Basic Samba install & minimal configuration
* [[Installing Samba from the command line{{!}}Installing Samba from the command line]]
 
* [[Adding a new drive from the command line{{!}}Adding a new drive from the command line]]
Create a test folder & file to be shared. (Assuming you'll replace '''USER''' with your own username...)
* [[Linux - A better .bashrc for root{{!}}A better .bashrc for root]]
* mkdir ~'''USER'''/share
* touch ~'''USER'''/share/Foo
 
Install Samba
* sudo apt install samba -y
 
Configure the test share
* sudo vi /etc/samba/smb.conf
 
[New_share]
    comment= my share
    path = /home/'''USER'''/share
    browseable  = yes
    Read only = no
    guest  ok = no
    valid users = '''USER'''
 
* sudo systemctl restart smbd
 
Set up username & password for Samba acess
* sudo smbpasswd -a '''USER'''
 
Additional bits to install (Client & utils & such...)
* sudo apt install cifs-utils samba-client -y
 
'''NOTE:''' At this point, the share can be accessed, but you need to know where it is because Samba does not advertise it's presence.
 
You '''can''' see the shares from the machine by entering <code>smb://'''MACHINENAME'''/</code> into the address bar of your file browser.


=Usage notes=
=Usage notes=
==Missing commands==
== Missing commands ==
If you're used to Ubuntu-derived Linuxes, you may note that a lot of commands cannot be found while signed in as a regular user. Before attempting to install them, check with '''sudo''' or while signed in as '''root'''. The root user account has a different search path that includes the programs that are normally not allowed to regular users anyhow.
If you're used to Ubuntu-derived Linuxes, you may note that a lot of commands cannot be found while signed in as a regular user. Before attempting to install them, check with '''sudo''' or while signed in as '''root'''. The root user account has a different search path that includes the programs that are normally not allowed to regular users anyhow.


Line 113: Line 117:


<code>sudo ifconfig</code> results in details about your network connection(s)
<code>sudo ifconfig</code> results in details about your network connection(s)
OTOH...
<code>ip a</code> does similar & is a more modern replacement.


[[Category:Linux]]
[[Category:Linux]]

Latest revision as of 01:16, 25 November 2023

Proven on:
Logo Debian.png
11 (bullseye) well... duh...

So...

A full desktop system as a server VM really is a bit silly.

Let's do something different.

Installing a minimal Debian

Installer Menu
Software selection
Installation Complete
Boot Screen
Great Success!
  • Insert the CD/ISO/whatever & boot the machine/VM from it.
    • I'm running it as VMs under ESXi
      • "ESXi 6.7 VM", "Linux", "Debian GNU/Linux 10 (64-bit)"
      • 4 CPUs, 4GB memory, 16GB storage
    • These days, I'm running it as VMs under Proxmox
      • "Linux", "5.x - 2.6 Kernel"
      • 4 Cores, 4GB memory, 16GB storage
      • Pretty much leaving everything else default...
  • When the installer menu appears, select "Install" rather than the default "Graphical Install" option
  • Cruze along configuring the system to your liking until you reach the screen titled "[!] Software selection"
  • Make sure that only SSH server and standard system utilities are selected, then continue
  • Keep cruzing along until it tells you Installation complete
  • When you tell it to continue, the system will reboot.

All done

The sequence in pictures...

Upon first boot up of your new system:

  • sudo apt update
  • sudo apt upgrade

(Because there're ALWAYS updates...)

Configuring the minimal Debian

Install & configure sudo

By default, root account is not enabled for login (other than directly at the console) to Debian. As a result, sudo authentication is needed. (But it doesn't seem to be installed by default...)

  1. Log in to the Debian machine and switch to root using the su command.
    • su -
    • (remember that root pasword you picked during install?)
  2. If sudo is not installed, install the sudo package using the following command:
    • apt install sudo
  3. Add an existing user with id=USER to group=sudo:
    • adduser USER sudo
  4. Log into the USER shell, and type the following command to verify that the user is authorised:
    • sudo -V

You have successfully configured sudo in Debian.

Install & configure vim

  • sudo apt install vim

Then fix the Visual Mode silliness...

  • vim ~/.vimrc
set mouse-=a
syntax on

Do the same for when you use it via sudo...

  • sudo vim /root/.vimrc

Set up a private bin directory

  • mkdir ~/bin

& make it useable:

  • vi ~/.bashrc
  1. set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
   PATH="$HOME/bin:$PATH"
fi

Aliases for ls

ls needs it's aliases set. (Who in heck doesn't use ll for ls -l???)

  • vi ~/.bashrc

Scroll down & you'll see:

# some more ls aliases
#alias ll='ls -l'
#alias la='ls -A'
#alias l='ls -CF'

Un-comment those aliases!

  • source ~/.bashrc

More Configurations

Usage notes

Missing commands

If you're used to Ubuntu-derived Linuxes, you may note that a lot of commands cannot be found while signed in as a regular user. Before attempting to install them, check with sudo or while signed in as root. The root user account has a different search path that includes the programs that are normally not allowed to regular users anyhow.

One good example:

ifconfig results in-bash: ifconfig: command not found

but...

sudo ifconfig results in details about your network connection(s)

OTOH...

ip a does similar & is a more modern replacement.