# - bof - #



# :a
# -  - #
# - Proxmox website - #
https://192.168.1.15:8006

Stop uServer-WebServer (uSP)


# :a.1
# -  - #
# - Choice 1 - #
# - Terminal - #
sshP
pct set 100 -mp0 /OSs/Data/Images/Programs/Linux.Img/SharedFiles,mp=/Data/WebServer/Images/Programs/Linux.Img/SharedFiles;


# :a.2
# -  - #
# - Choice 2 - #
# - Terminal - #
# - Edit container configuration file in proxmox uServerProxmox - #
sshP

vim /etc/pve/lxc/100.conf;

arch: amd64
cores: 4
features: nesting=1
hostname: uServer
memory: 2048
mp0: /OSs/Data/Images/Programs/Linux.Img/SharedFiles,mp=/Data/WebServer/Images/Programs/Linux.Img/SharedFiles
nameserver: 8.8.8.8
net0: name=eth0,bridge=vmbr0,firewall=1,gw=192.168.1.1,hwaddr=BC:24:11:A7:F8:0C,ip=192.168.1.100/24,type=veth
ostype: ubuntu
rootfs: OSs:subvol-100-disk-0,size=30G
searchdomain: 4.4.4.4
swap: 1024
unprivileged: 1



# :a.3
# -  - #
# - Choice 2 - #
# - Terminal - #
# - Edit container configuration file in proxmox uServer-MySQL - #
sshP

cd /OSs/Data;

mkdir -p /OSs/Data/Databases;

╭── # is_derayo@proxmox-is /OSs/Data :
╰─▷ $ la
total 11K
drwxrwxr-x 6 is_derayo is_derayo 6 Oct 28 18:50 ./
drwxrwxr-x 7 root      is_derayo 7 Oct 27 12:54 ../
drwxrwxr-x 2 is_derayo is_derayo 3 Oct 29 19:02 Databases/
drwxrwxr-x 5 is_derayo is_derayo 5 Apr 24  2024 Images/


# :a.4
# -  - #
# - Create Databases group - #
sudo groupadd -g 101000 databases;
sudo usermod -aG databases is_derayo;


╭── # is_derayo@proxmox-is /OSs/Data :
╰─▷ $ sudo chown -R 101000:101000 /OSs/Data/Databases;
sudo chown -R 101000:101000 /OSs/Data/Databases;


╭── # is_derayo@proxmox-is /OSs/Data :
╰─▷ $ la
total 11K
drwxrwxr-x 6 is_derayo is_derayo 6 Oct 28 18:50 ./
drwxrwxr-x 7 root      is_derayo 7 Oct 27 12:54 ../
drwxrwxr-x 2    101000 databases 3 Oct 29 19:02 Databases/
drwxrwxr-x 5 is_derayo is_derayo 5 Apr 24  2024 Images/
drwxrwxr-x 4 is_derayo is_derayo 4 Apr 24  2024 Plex/
drwxrwxr-x 2 is_derayo is_derayo 2 Apr 20  2024 Sambashare/





vim /etc/pve/lxc/110.conf;

arch: amd64
cores: 4
features: nesting=1
hostname: uServer
memory: 2048
mp0: /OSs/Data/Databases,mp=/Data/Databases
nameserver: 8.8.8.8
net0: name=eth0,bridge=vmbr0,firewall=1,gw=192.168.1.1,hwaddr=BC:24:11:A7:F8:0C,ip=192.168.1.100/24,type=veth
ostype: ubuntu
rootfs: OSs:subvol-100-disk-0,size=30G
searchdomain: 4.4.4.4
swap: 1024
unprivileged: 1



#sudo vim /etc/subuid;
#sudo vim /etc/subgid;




# :b
# -  - #
# - Terminal - #
# - Create hard links to files you want to share in WebServer - #

╭── # is_derayo@proxmox-is ~ :
╰─▷ $ cd /OSs/Data/Images/Programs/Linux.Img/SharedFiles;

cd /OSs/Data/Images/Programs/Linux.Img/SharedFiles;

╭── # is_derayo@proxmox-is /OSs/Data/Images/Programs/Linux.Img/SharedFiles :
╰─▷ $ ln /OSs/Data/Images/Programs/Linux.Img/Linux_Ubuntu.Img/'Ubuntu_24.10_Xubuntu(64bit)-OracularOriole.iso' .;

ln /OSs/Data/Images/Programs/Linux.Img/Linux_Ubuntu.Img/'Ubuntu_24.10_Xubuntu(64bit)-OracularOriole.iso' .;
ln /OSs/Data/Images/Programs/Linux.Img/Linux_Ubuntu.Img/'Ubuntu_24.10_Desktop(64bit)-OracularOriole.iso' .;
ln /OSs/Data/Images/Programs/Linux.Img/Linux_Ubuntu.Img/Ubuntu_24.10_CinnamonRemix\(64bit\)-OracularOriole.iso .;



# :c.1
# -  - #
# - Proxmox - Terminal - #
# - Change name to a Container - #

╭── # root@proxmox-is /etc/pve :
╰─▷ $ pct set 100 --hostname uServer-WebServer;

pct set 100 --hostname uServer-WebServer;

sudo lxc-info --name 110;


# :c.2
# -  - #
# - Proxmox - Shell - #
# - Open container 140 terminal when fstab failed - #

pct enter 140



# :d
# -  - #
# - uServer - #
# - Create user - #

sudo adduser is_derayo;
sudo usermod -aG sudo is_derayo;



# :e
# -  - #
# - uServer - #
# - Install openssh-server - #

sudo apt update -y && sudo apt upgrade -y && sudo apt autoremove -y;
sudo apt install vim openssh-server screenfetch -y;

sudo vim /etc/ssh/sshd-confg;

PermitRootLogin yes
PasswordAuthentication yes

:wq

sudo server ssh restart;



# :f
# -  - #
# - uServer - #
# - Create .bashrc and authorized_keys files - #

on   is_derayo
&    root





# :z
# -  - #
# - uServer - #
# - Full virtual machine install - #

# :z.1
# -  - #
# - Mount Data from terminal - #
sudo sshfs -o allow_other,default_permissions is_derayo@192.168.1.15:/OSs/Data/Images/Programs /Data/WebServer/ProxmoxVE;

# :z.2
# -  - #
# - Configuring Data from fstab - #

# <file system>                            <dir>  <type>  <options>  <dump>  <pass>
/swap.img                                   none   swap    sw         0       0
UUID=bcef5975-dd89-4f34-95c2-53e2d5793b68   /      ext4    defaults   0       1


<<'comment'
# -  - #
# - Complete ProxmoxVE root mounting - #
# - ProxmoxVE - #
# - Run in u150 terminal before mounting partition in fstab - #


echo "paste_the_correct_key_here" >> ~/.ssh/authorized_keys;

echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDczyS4r/lLGBqM2VzgrpGcSLBbj4Kw2TTOTFV4C1MUoACNqB6dEQjLCU87EqU1ihBYWMs6dWwyFNsAj8W2hWjI3/vuMoiRhjtqCgnPcIzomP33uxE+MNKHx1ulLtdTinb/wXyMj0ajgnyOKw2IQQXMgSROLHNqxt6hLVXe66Jl1UXXvToZuDSP52v6bou2/PN3AzWrnSm1GEfL3mPvt2TtjcIaktoBEwem3vxDPNAjW0OgAkzi8bJGT1x9bz99Cozc5cd3ZGddXHtXV51JuHmvauRWHd+GOq2evnlWntmDv6R78+5irzQmunZKaeI5Or6wKv3MiMtpRU7WQEinDjvo3nhZBIafBRfuYMXP2gVf09z/6F5iqyharxumPjrw+sHb/5Gu1g7L1NN72vLD6U8nSL2r1U/Rvt0F3CHTu7DjshZLWzD4gqd76nivGRmOsl9oy/0G1nO9qPOcFwuNKmZH8VEswmH/kuUXFILTTW5n6zR60Dsmc0KqV/e4dYeWGBE= is_derayo@uServer" >> ~/.ssh/authorized_keys


echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCohQ7aUbjoJZclrQrJCm61Z7EJMqRjnK9M9eUR5XvC5KnjaLrL5vtokTWAoemyRLV899PJ1mEbbY8Qbqnx1kRLthLvKJuZrUPC1V34mjVj1oNRhOasV9oxvsgWmz1WVEXRhdGqCF1wBmcrUV3Fit8tXFA4xP6+wcSskhAGBkN0OJGarYqv5qelKzaBwguQEfoAxU2tOhMoNJ+70bQyTIWelLFN6h9fhCj/pImCCs4+YhprtiIEeBH66IW7cMKOz8c5p0fixtNEVFAAlrjDf96aa1ANji/bgZY/RfQu5kivPQZNZQuDffH3nIYn/RZ95m/MW7uRJulY0yBCjcdpGddRtOR4m88jmxFhbv+qtU0wM8nFyMb6RTfsjp02NmWjFzwAyFsPBa7a94O+cB5q5+N61b/FgLn+uQ+UHgLPrlAcTOgKJNi1mOnnNt5Uo+w2HAIJwvFRg6lydfOksddhpii8v6NZKqWbmp8MmJ3Y9tAT5DqL43II8aZ1CpvF7O1o+x8= root@uServer" >> ~/.ssh/authorized_keys;



  In ProxmoxVE:
  ssh -i /home/is_derayo/.ssh/id_rsa is_derayo@192.168.1.15;
  chmod 600 ~/.ssh/authorized_keys;

  In uServer-150 (u150):

  sudo ssh-keygen -f '/root/.ssh/known_hosts' -R '192.168.1.15';
  sudo ssh -i /home/is_derayo/.ssh/id_rsa is_derayo@192.168.1.15 'echo success';

  sshfs is_derayo@192.168.1.15:/OSs/Data/Images/Programs /Data/WebServer/ProxmoxVE;
  sudo umount /Data/WebServer/ProxmoxVE;
  
  sudo sshfs -o IdentityFile=/home/is_derayo/.ssh/id_rsa,allow_other is_derayo@192.168.1.15:/OSs/Data/Images/Programs /Data/WebServer/ProxmoxVE;

comment

sudo vim /etc/fstab;

is_derayo@192.168.1.15:/OSs/Data/Images/Programs /Data/WebServer/ProxmoxVE fuse.sshfs _netdev,allow_other,noatime,follow_symlinks,IdentityFile=/home/is_derayo/.ssh/id_rsa,reconnect,x-systemd.automount 0 0



# :z.3
# -  - #
# - Process - #
sudo systemctl daemon-reload;
sudo mount -av;



# :z.4
# -  - #
# - Final /etc/fstab file - #

# <file system>                            <dir>  <type>  <options>  <dump>  <pass>
/swap.img                                   none   swap    sw         0       0
UUID=bcef5975-dd89-4f34-95c2-53e2d5793b68   /      ext4    defaults   0       1



# -  - #
# - Complete ProxmoxVE root mounting - #
# - ProxmoxVE - #
#
#  In uServer-150 (u150):
#
#  sudo ssh-keygen -f '/root/.ssh/known_hosts' -R '192.168.1.15';
#  sudo ssh -i /home/is_derayo/.ssh/id_rsa is_derayo@192.168.1.15 'echo success';
#
#  sshfs is_derayo@192.168.1.15:/OSs/Data/Images/Programs /Data/WebServer/ProxmoxVE;
#  sudo umount /Data/WebServer/ProxmoxVE;
#
#  sudo sshfs -o IdentityFile=/home/is_derayo/.ssh/id_rsa,allow_other is_derayo@192.168.1.15:/OSs/Data/Images/Programs /Data/WebServer/ProxmoxVE;
# -  - #

is_derayo@192.168.1.15:/OSs/Data/Images/Programs /Data/WebServer/ProxmoxVE fuse.sshfs _netdev,allow_other,noatime,follow_symlinks,IdentityFile=/home/is_derayo/.ssh/id_rsa,reconnect,x-systemd.automount 0 0





# :z.5
# -  - #
# - Backup the uServer (u150) - #

# -  - #
# - ssh as root into ProxmoxVE 192.168.1.15 - #
ssh root@192.168.1.15;



# -  - #
# - Listing VMs - #
qm list;
qm list | grep running;

# -  - #
# - Stop Containers - #
pct wtop 100;

# -  - #
# - Stop VMs - #
qm shutdown 150;
qm stop 150 --overrule-shutdown true;





<<'comment'
# -  - #
# - Esencial software - #
xdg-user-dirs-update;
sudo apt install dialog duf curl figlet git lolcat neovim pv webapp-manager -y;
sudo apt install dialog duf curl figlet git htop inxi lolcat net-tools neovim pv webapp-manager -y;

# -  - #
# - Timezone - #
sudo timedatectl set-ntp true;
sudo timedatectl set-timezone America/New_York;
timedatectl status;
comment



# - eof - #