mirror of
https://github.com/IntenseWebs/servercode.git
synced 2024-11-24 17:40:17 -06:00
Compare commits
3 Commits
77afc68013
...
b72f9d8916
Author | SHA1 | Date | |
---|---|---|---|
|
b72f9d8916 | ||
|
34bf28f977 | ||
|
5e3acf7540 |
@ -11,13 +11,14 @@ apt install sudo
|
||||
----------------------------------------------------------
|
||||
# ADD username to /etc/sudoers right under root user
|
||||
vi /etc/sudoers
|
||||
username ALL=(ALL) ALL
|
||||
username ALL=(ALL:ALL) ALL
|
||||
----------------------------------------------------------
|
||||
# vi /etc/sudoers.d/mynewuser
|
||||
# mynewuser ALL=(ALL) NOPASSWD: ALL
|
||||
# chmod 440 /etc/sudoers.d/mynewuser
|
||||
----------------------------------------------------------
|
||||
sudo apt install openssh-server
|
||||
# /etc/init.d/ssh restart
|
||||
systemctl enable sshd
|
||||
systemctl start sshd
|
||||
# sudo firewall-cmd --add-service=ssh --permanent && firewall-cmd --reload
|
||||
|
Binary file not shown.
46
disks.txt
46
disks.txt
@ -1,46 +1,58 @@
|
||||
# https://linuxconfig.org/linux-lvm-logical-volume-manager
|
||||
# apt-get install lvm2 # sudo dnf install lvm2
|
||||
# fdisk -l # lsblk # lsblk -fe7 # blkid # parted -l # parted /dev/sde u s p # df -hT # du -sh /home #
|
||||
# Check FREE SPACE # sfdisk --list-free /dev/vda # hwinfo --short --block # cat /proc/partitions # sudo hdparm -t --direct /dev/nvme0n1p1
|
||||
# fdisk -l # lsblk # lsblk -fe7 # blkid # parted -l # parted /dev/sde u s p # df -hT # du -sh /home
|
||||
# Check FREE SPACE # sfdisk --list-free /dev/vda # hwinfo --short --block # cat /proc/partitions #
|
||||
# Check SPPED # sudo hdparm -t --direct /dev/nvme0n1p1
|
||||
# pvs, vgs, lvs, pvdisplay, vgdisplay, lvdisplay
|
||||
|
||||
# WIPE DESTROY DISK CONTENTS
|
||||
dd if=/dev/zero of=/dev/sdb bs=512 count=1
|
||||
# shred -n 5 -vz /dev/sdb
|
||||
# scrub -p dod /dev/sdb
|
||||
umount /dev/vgiso/iso && umount /dev/vgvm/vm && umount /dev/vgbackups/backups
|
||||
dd if=/dev/zero of=/dev/sdb bs=512 count=1
|
||||
|
||||
# PARTITION ON CMD LINE
|
||||
# cfdisk /dev/sdb
|
||||
fdisk /dev/sdb # then m, p, g, n, w, q
|
||||
Device Start End Sectors Size Type
|
||||
/dev/sdb1 419432448 838862847 419430400 200G Linux filesystem
|
||||
/dev/sdb2 838862848 1048578047 209715200 100G Linux filesystem
|
||||
/dev/sdb3 1048578048 3907028991 2858450944 1.3T Linux filesystem
|
||||
mkfs.ext4 -L VM /dev/sdb1
|
||||
mkfs.ext4 -L ISO /dev/sdb2
|
||||
mkfs.ext4 -L BACKUPS /dev/sdb3
|
||||
|
||||
# CREATE LVM VOLUME(s)
|
||||
pvcreate /dev/sdb1
|
||||
vgcreate vgiso /dev/sdb1
|
||||
lvcreate vgiso -l 100%FREE -n iso
|
||||
pvcreate /dev/sdb2
|
||||
vgcreate vgvm /dev/sdb2
|
||||
vgcreate vgvm /dev/sdb1
|
||||
lvcreate vgvm -l 100%FREE -n vm
|
||||
pvcreate /dev/sdb2
|
||||
vgcreate vgiso /dev/sdb2
|
||||
lvcreate vgiso -l 100%FREE -n iso
|
||||
pvcreate /dev/sdb3
|
||||
vgcreate vgbackups /dev/sdb3
|
||||
lvcreate vgbackups -l 100%FREE -n backups
|
||||
# lvcreate vgextra-vm -L 500G -n vg-vm vgextra
|
||||
# lvcreate vgextra-backups -L 900G -n vg-backups vgextra
|
||||
lvdisplay
|
||||
mkfs.ext4 -m 0 /dev/vg_extra/vg-iso
|
||||
mkfs.ext4 -m 0 /dev/vg_extra/vg-vm
|
||||
mkfs.ext4 -m 0 /dev/vg_extra/vg-backups
|
||||
mkfs.ext4 -m 0 /dev/vgvm/vm
|
||||
mkfs.ext4 -m 0 /dev/vgiso/iso
|
||||
mkfs.ext4 -m 0 /dev/vgbackups/backups
|
||||
mkdir /iso && mkdir /vm && mkdir /backups
|
||||
vi /etc/fstab
|
||||
/dev/vg_extra/vg-iso /iso ext4 defaults 0 0
|
||||
/dev/vg_extra/vg-vm /vm ext4 defaults 0 0
|
||||
/dev/vg_extra/vg-backups /backups ext4 defaults 0 0
|
||||
/dev/vgiso/iso /iso ext4 defaults 0 0
|
||||
/dev/vgvm/vm /vm ext4 defaults 0 0
|
||||
/dev/vgbackups/backups /backups ext4 defaults 0 0
|
||||
systemctl daemon-reload
|
||||
mount -a
|
||||
|
||||
# REMOVE LVM VOLUME
|
||||
pvremove /dev/sdb --force --force
|
||||
umount /dev/vg_extra/vg-backups
|
||||
lvremove /dev/vg_extra/vg-backups
|
||||
# REMOVE LVM VOLUME # df -hT # vi /etc/fstab
|
||||
umount /dev/vgiso/iso && umount /dev/vgvm/vm && umount /dev/vgbackups/backups
|
||||
lvchange -an /dev/vgiso/iso && lvchange -an /dev/vgvm/vm && lvchange -an /dev/vgbackups/backups
|
||||
lvremove /dev/vgiso/iso && lvremove /dev/vgvm/vm && lvremove /dev/vgbackups/backups
|
||||
lvscan
|
||||
vgremove vgiso && vgremove vgvm && vgremove vgbackups
|
||||
pvremove /dev/sdd1 --force --force && pvremove /dev/sdd2 --force --force && pvremove /dev/sdd3 --force --force
|
||||
|
||||
# RESIZE LVM AS ROOT: https://www.golinuxcloud.com/lvm-shrink-logical-volume/
|
||||
df -hT /home
|
||||
|
15
proxmox.txt
Normal file
15
proxmox.txt
Normal file
@ -0,0 +1,15 @@
|
||||
cd /usr/share/javascript/proxmox-widget-toolkit
|
||||
cp proxmoxlib.js proxmoxlib.js.bak
|
||||
nano proxmoxlib.js
|
||||
CTRL-W (find): if (res ==
|
||||
|
||||
Hit return and this should take you to a line like this (backspace it out)
|
||||
if (res === null || res === undefined || !res || res
|
||||
.data.status.toLowerCase() !== 'active') {
|
||||
|
||||
Replace the line with this
|
||||
if (false) {
|
||||
|
||||
systemctl daemon-reload
|
||||
|
||||
# UPDATE HOST > REPOSITORIES - DISABLE BOTH ENTERPRISE REPOSITORIES & ADD pve-no-subscription
|
@ -19,8 +19,58 @@ adduser \
|
||||
--create-home \
|
||||
boringproxy
|
||||
|
||||
#USER WITH PASSWORD
|
||||
sudo adduser --system --group --home /home/mynewuser mynewuser
|
||||
passwd boringproxy
|
||||
su - boringproxy
|
||||
sudo usermod -a -G libvirt,kvm $USER
|
||||
su - mynewuser
|
||||
passwd
|
||||
|
||||
adduser --help
|
||||
adduser [--uid id] [--firstuid id] [--lastuid id]
|
||||
[--gid id] [--firstgid id] [--lastgid id] [--ingroup group]
|
||||
[--add-extra-groups] [--shell shell]
|
||||
[--comment comment] [--home dir] [--no-create-home]
|
||||
[--allow-all-names] [--allow-bad-names]
|
||||
[--disabled-password] [--disabled-login]
|
||||
[--conf file] [--quiet] [--verbose] [--debug]
|
||||
user
|
||||
Add a normal user
|
||||
|
||||
adduser --system
|
||||
[--uid id] [--group] [--ingroup group] [--gid id]
|
||||
[--shell shell] [--comment comment] [--home dir] [--no-create-home]
|
||||
[--conf file] [--quiet] [--verbose] [--debug]
|
||||
user
|
||||
Add a system user
|
||||
|
||||
adduser --group
|
||||
[--gid ID] [--firstgid id] [--lastgid id]
|
||||
[--conf file] [--quiet] [--verbose] [--debug]
|
||||
group
|
||||
addgroup
|
||||
[--gid ID] [--firstgid id] [--lastgid id]
|
||||
[--conf file] [--quiet] [--verbose] [--debug]
|
||||
group
|
||||
Add a user group
|
||||
|
||||
addgroup --system
|
||||
[--gid id]
|
||||
[--conf file] [--quiet] [--verbose] [--debug]
|
||||
group
|
||||
Add a system group
|
||||
|
||||
adduser USER GROUP
|
||||
-------------------------------------------------------------
|
||||
deluser --help
|
||||
deluser [--system] [--remove-home] [--remove-all-files] [--backup]
|
||||
[--backup-to dir] [--backup-suffix str] [--conf file]
|
||||
[--quiet] [--verbose] [--debug] user
|
||||
|
||||
remove a normal user from the system
|
||||
|
||||
deluser --group [--system] [--only-if-empty] [--conf file] [--quiet]
|
||||
[--verbose] [--debug] group
|
||||
delgroup [--system] [--only-if-empty] [--conf file] [--quiet]
|
||||
[--verbose] [--debug] group
|
||||
remove a group from the system
|
||||
|
||||
deluser [--conf file] [--quiet] [--verbose] [--debug] user group
|
||||
remove the user from a group
|
||||
|
Loading…
Reference in New Issue
Block a user