duan-li / worklog

1 stars 0 forks source link

alpine linux server provision #13

Open duan-li opened 4 years ago

duan-li commented 4 years ago

Package

# vi /etc/apk/repositories, remove # 
apk update
apk add python3 docker docker-compose nfs-utils git dhcpcd openssh-server sudo
rc-update add docker boot
rc-update add sshd boot
ssh-keygen

Mount

mount -t nfs -o nolock <ip>:/path /mng

In /etc/fstab file

<ip>:/path   /root   nfs     nolock,nofail,x-systemd.automount,x-systemd.requires=network-online.target      0 0

and create /etc/network/if-up.d/fstab file

#!/bin/sh
mount -a
chmod +x /etc/network/if-up.d/fstab

Network

`/etc/dhcpcd.conf

interface wlan0
static ip_address=192.168.1.45/24
static routers=192.168.1.1
static domain_name_servers=1.1.1.1 1.0.0.1

SSHD

/etc/ssh/sshd_config

PermitRootLogin yes

New user

adduser username

sudo

file /etc/sudoers

%wheel ALL=(ALL) ALL
%sudo   ALL=(ALL) ALL 
ALL ALL=(ALL) ALL
duan-li commented 4 years ago

clean up

echo '' > ~/.ash_history
duan-li commented 4 years ago

Mount relate