Linux barebones quickstart: Difference between revisions

From Bitpost wiki
m (M moved page Linux barebones setup to Linux barebones quickstart without leaving a redirect: typo)
 
(73 intermediate revisions by the same user not shown)
Line 1: Line 1:
* '''SSH'''
=== Install the distro ===
  # openssh-server defaults are ok but see /etc/ssh/sshd_config for details
Set up [[Ubuntu quickstart|Ubuntu]] or [[Centos quickstart|Centos]] or some small embedded whateverism...
  cd ~/.ssh
 
  scp [another-working-setup]:.ssh/authorized_keys .
==== (Optional) Change the IP ====
  scp [another-working-setup]:.ssh/id_rsa_3072_nopswd .
 
  scp [another-working-setup]:.ssh/config .
If this is a VM clone, [[Set your IP|CHANGE YOUR IP NOW]] before you tear your hair out.
  ln -s id_rsa_3072_nopswd id_rsa
 
* '''SCRIPTS'''
==== (Optional) Set up hostname ====
 
If you've cloned a VM, or you are using any "lite" OS that doesn't have an installer, you'll need to set your hostname to something unique, as a first step:
sudo emacs /etc/hostname && sudo hostname newname  # use hostname cmd to set it right away
  # NOTE that systemd can also be used: sudo hostnamectl set-hostname newname
# /etc/hosts changes should not be needed, if hostnames are properly configured (dnsmasq DNS -or- work DNS will provide resolution)
 
==== (Optional) Set up user m ====
 
"Lite" OS installs will not add a user for you, so if you don't have user m, [[Add a user|add user m now]].
 
==== (Optional) Limit system log size ====
 
Prevent endless system logging [[Systemd#Log_limit|here]].
 
=== Set up IP ===
 
On home lan, bitpost dnsmasq doles out the ips based on MAC:
  hostname # make note
ip address # make note of MAC - there may be more than one (eg: wired and wifi)
[bitpost#] emacs config/etc/dnsmasq.d/mdm_lan_dnsmasq.conf && sudo service dnsmasq restart
# reacquire IP on new box
 
=== Copy ssh keys ===
  sudo apt install openssh-server # if needed (usually)
ssh newbox # via password
# 2022 keys
mkdir -p .ssh/2022
[bitpost#] scp -r .ssh/2022/id_ed25519* newguy:.ssh/2022/
cd .ssh && ln -s 2022/id_ed25519 . && cat 2022/id_ed25519.pub >> authorized_keys
It's time to deprecate this one...
# 2018 keys
  mkdir -p .ssh/2018
  [bitpost#] scp -r .ssh/2018/id_rsa* newguy:.ssh/2018/
  cd .ssh && ln -s 2018/id_rsa . && cat 2018/id_rsa.pub >> authorized_keys
 
=== Install basic tools ===
sudo apt update && sudo apt upgrade -y && sudo apt autoremove -y
sudo apt install git curl emacs-nox # ubuntu server
sudo apt install git curl emacs    # ubuntu desktop
sudo yum install git curl emacs-nox # centos
 
=== Set up scripts ===
  cd && mkdir development && cd development
  cd && mkdir development && cd development
  git clone bitpost.com:development/scripts.git  
  git clone morosoph:development/scripts.git  
  cd && ln -s development/scripts scripts
  ./scripts/setup_linux.sh [desktop|nodesk] # to continue bootstrapping
mkdir scripts/[distro]/[new machine]
 
* '''CONFIG'''
That's it, get on with your life.
cd ~/development
git clone bitpost.com:development/config.git
cd config
mkdir [new machine]
mkdir [new machine]/[distro]
cd && ln -s /home/m/development/config/[new machine]/[distro] config

Latest revision as of 20:33, 27 January 2023

Install the distro

Set up Ubuntu or Centos or some small embedded whateverism...

(Optional) Change the IP

If this is a VM clone, CHANGE YOUR IP NOW before you tear your hair out.

(Optional) Set up hostname

If you've cloned a VM, or you are using any "lite" OS that doesn't have an installer, you'll need to set your hostname to something unique, as a first step:

sudo emacs /etc/hostname && sudo hostname newname  # use hostname cmd to set it right away
# NOTE that systemd can also be used: sudo hostnamectl set-hostname newname
# /etc/hosts changes should not be needed, if hostnames are properly configured (dnsmasq DNS -or- work DNS will provide resolution)

(Optional) Set up user m

"Lite" OS installs will not add a user for you, so if you don't have user m, add user m now.

(Optional) Limit system log size

Prevent endless system logging here.

Set up IP

On home lan, bitpost dnsmasq doles out the ips based on MAC:

hostname # make note
ip address # make note of MAC - there may be more than one (eg: wired and wifi)
[bitpost#] emacs config/etc/dnsmasq.d/mdm_lan_dnsmasq.conf && sudo service dnsmasq restart
# reacquire IP on new box

Copy ssh keys

sudo apt install openssh-server # if needed (usually)
ssh newbox # via password
# 2022 keys
mkdir -p .ssh/2022
[bitpost#] scp -r .ssh/2022/id_ed25519* newguy:.ssh/2022/
cd .ssh && ln -s 2022/id_ed25519 . && cat 2022/id_ed25519.pub >> authorized_keys

It's time to deprecate this one...

# 2018 keys
mkdir -p .ssh/2018
[bitpost#] scp -r .ssh/2018/id_rsa* newguy:.ssh/2018/
cd .ssh && ln -s 2018/id_rsa . && cat 2018/id_rsa.pub >> authorized_keys

Install basic tools

sudo apt update && sudo apt upgrade -y && sudo apt autoremove -y

sudo apt install git curl emacs-nox # ubuntu server
sudo apt install git curl emacs     # ubuntu desktop
sudo yum install git curl emacs-nox # centos

Set up scripts

cd && mkdir development && cd development
git clone morosoph:development/scripts.git 
./scripts/setup_linux.sh [desktop|nodesk] # to continue bootstrapping

That's it, get on with your life.