Files
.infineon/_-Review/inspiron-660-ubuntu.md
2024-12-09 10:43:40 -07:00

210 lines
5.8 KiB
Markdown

---
created: 2024-12-07T20:28:26.000Z
type: note
updated: 2024-12-07T20:28:26.000Z
---
# Inspiron-660-Ubuntu
## authorized_keys
```bash
ssh root@ubuntu.phares.duckdns.org -i C:/Users/phares/.ssh/id_ed25519
```
```bash 1733599944395 = 638691967443950000 = Sat Dec 07 2024 12:32:23 GMT-0700 (Mountain Standard Time)
sudo -i
cat /root/.ssh/authorized_keys
nano /root/.ssh/authorized_keys
```
```conf 1733599946671 = 638691967466710000 = Sat Dec 07 2024 12:32:26 GMT-0700 (Mountain Standard Time)
...
```
```bash 1733599948150 = 638691967481500000 = Sat Dec 07 2024 12:32:27 GMT-0700 (Mountain Standard Time)
exit
```
## Timezone
```bash 1733599949970 = 638691967499700000 = Sat Dec 07 2024 12:32:29 GMT-0700 (Mountain Standard Time)
timedatectl set-timezone America/Phoenix
date
Sat Dec 7 12:30:22 PM MST 2024
```
```bash 1733599973070 = 638691967730700000 = Sat Dec 07 2024 12:32:52 GMT-0700 (Mountain Standard Time)
apt-get update
apt upgrade -y
```
## Create Users
```bash 1733600162490 = 638691969624900000 = Sat Dec 07 2024 12:36:02 GMT-0700 (Mountain Standard Time)
chown podman:podman -R /home/podman
#
adduser lphares
#
mkdir /home/lphares/.ssh
cp /root/.ssh/authorized_keys /home/lphares/.ssh/authorized_keys
chown lphares:lphares -R /home/lphares
#
adduser bmiller
#
mkdir /home/bmiller/.ssh
cp /root/.ssh/authorized_keys /home/bmiller/.ssh/authorized_keys
chown bmiller:bmiller -R /home/bmiller
#
adduser pcortez
#
mkdir /home/pcortez/.ssh
cp /root/.ssh/authorized_keys /home/pcortez/.ssh/authorized_keys
chown pcortez:pcortez -R /home/pcortez
```
## Directory Share
```bash 1733600270939 = 638691970709390000 = Sat Dec 07 2024 12:37:50 GMT-0700 (Mountain Standard Time)
adduser bmiller lphares
sudo usermod -a -G lphares bmiller
newgrp lphares
systemctl restart ssh
```
## Podman Quadlet Rootless Example
```bash 1733600416426 = 638691972164260000 = Sat Dec 07 2024 12:40:16 GMT-0700 (Mountain Standard Time)
apt-get install podman -y
apt-cache rdepends podman-compose
apt-get install podman-compose -y
# apt-get remove podman-compose -y
# apt-get purge podman-compose -y
adduser podman sudo
passwd podman
sudo -iu podman
loginctl enable-linger
# 2.
podman --version
# podman version 4.9.3
# https://www.redhat.com/sysadmin/quadlet-podman
cd ~/
mkdir -p .config/containers/systemd/
# cp -R /run/user/0/ /run/user/1000/
mkdir -p /run/user/1000/
chown -R podman:podman /run/user/1000/
sudo -iu podman
cd ~/
mkdir -p ~/.bashrc.d
echo "export XDG_RUNTIME_DIR=/run/user/$(id -u)" > ~/.bashrc.d/systemd
source ~/.bashrc.d/systemd
loginctl enable-linger 1000
systemctl --user daemon-reload
podman ps -a --sort names
systemctl --user enable --now podman.socket
exit
```
## Cockpit
- [cockpit](https://cockpit-project.org/)
- [podman](https://192.168.11.2:9090/podman#/?container=all)
```bash 1733600698460 = 638691974984600000 = Sat Dec 07 2024 12:44:58 GMT-0700 (Mountain Standard Time)
# apt install chkservice -y
apt-cache rdepends cockpit
apt install cockpit -y
# https://192.168.11.28:9090
# https://blog.while-true-do.io/podman-web-ui-via-cockpit/
apt-get install cockpit cockpit-podman -y
systemctl enable --now cockpit.socket
```
## how to run a shell scripts at every login
- [how-to-run-a-shell-scripts-at-every-login](https://serverfault.com/questions/782433/how-to-run-a-shell-scripts-at-every-login-in-centos)
```bash 1733600773580 = 638691975735800000 = Sat Dec 07 2024 12:46:13 GMT-0700 (Mountain Standard Time)
sudo -iu podman
nano ~/.bash_profile
```
```conf 1733600777580 = 638691975775800000 = Sat Dec 07 2024 12:46:17 GMT-0700 (Mountain Standard Time)
cd ~/
echo "export XDG_RUNTIME_DIR=/run/user/$(id -u)" > ~/.bashrc.d/systemd
source ~/.bashrc.d/systemd
loginctl enable-linger 1000
systemctl --user daemon-reload
podman ps -a --sort names
```
## Disable IPv6
```bash 1733602187270 = 638691989872700000 = Sat Dec 07 2024 13:09:46 GMT-0700 (Mountain Standard Time)
# https://intercom.help/privatevpn/en/articles/6440374-how-to-disable-ipv6-on-ubuntu-and-fedora-linux
nano /etc/sysctl.conf
```
```conf 1733602189051 = 638691989890510000 = Sat Dec 07 2024 13:09:48 GMT-0700 (Mountain Standard Time)
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
```
```bash 1733602191200 = 638691989912000000 = Sat Dec 07 2024 13:09:50 GMT-0700 (Mountain Standard Time)
sysctl -p
cat /proc/sys/net/ipv6/conf/all/disable_ipv6
exit
reboot
```
```bash 1733602193360 = 638691989933600000 = Sat Dec 07 2024 13:09:52 GMT-0700 (Mountain Standard Time)
nano /etc/default/grub
```
```conf 1733602195040 = 638691989950400000 = Sat Dec 07 2024 13:09:54 GMT-0700 (Mountain Standard Time)
# https://opensource.com/article/22/8/disable-ipv6
# GRUB_CMDLINE_LINUX_DEFAULT=""
GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1 quiet splash"
# GRUB_CMDLINE_LINUX=""
GRUB_CMDLINE_LINUX="ipv6.disable=1"
```
```bash 1733602197360 = 638691989973600000 = Sat Dec 07 2024 13:09:56 GMT-0700 (Mountain Standard Time)
grub-mkconfig
exit
reboot
```
## apt
```bash 1733602260381 = 638691990603810000 = Sat Dec 07 2024 13:10:59 GMT-0700 (Mountain Standard Time)
apt install ncdu -y
apt install nala -y
nala install git -y
nala install links -y
```
## Verify Podman Quadlet
```bash 1733602652339 = 638691994523390000 = Sat Dec 07 2024 13:17:31 GMT-0700 (Mountain Standard Time)
mkdir /etc/containers/systemd/users/1000
sudo -iu podman
/usr/libexec/podman/quadlet -dryrun --user
# No files parsed from [
# /home/podman/.config/containers/systemd
# /etc/containers/systemd/users/1000
# /etc/containers/systemd/users
# ]
mkdir /home/podman/libexec-podman-quadlet-output
/usr/libexec/podman/quadlet --user /home/podman/libexec-podman-quadlet-output
```
## Log
```bash 1733603306861 = 638692001068610000 = Sat Dec 07 2024 13:28:26 GMT-0700 (Mountain Standard Time)
cp ~/.bash_history /etc/bash_history_2024-12-07.txt
# cat /etc/bash_history_2024-12-07.txt
exit
```