You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

76 lines
1.9 KiB

hostname xxx.yimian.xyz
hostnamectl set-hostname xxx.yimian.xyz
$ vi /etc/systemd/logind.conf
HandleLidSwitch=ignore
$ systemctl restart systemd-logind
# $ vi /etc/sysconfig/network-scripts/ifcfg-enp1s0
#/etc/passwd
iotcat:x:1000:1000::/home/iotcat:/bin/bash
#ushio:x:1001:1001::/home/ushio:/sbin/nologin
$ visudo
Defaults rootpw
#Defaults:ushio !rootpw
iotcat ALL=(ALL) ALL
#ushio ALL=(ushio) ALL
# $ passwd -d ushio
#/etc/ssh/sshd_config
PermitRootLogin no
Port 2222
$ systemctl restart sshd
# ~/.ssh/authorized_keys
add .pub
sudo ln -s /home/iotcat/.ssh /root/.ssh
# on remotes
ssh-copy-id iotcat@xxx.yimian.xyz
systemctl stop firewalld
systemctl disable firewalld
sed -i s/SELINUX=enforcing/SELINUX=disabled/g /etc/selinux/config
setenforce 0
yum update -y
yum install epel-release -y
yum update -y
yum install -y wget git vim screen ntp
# enable ntp
systemctl start ntpd
systemctl enable ntpd
systemctl start crond
systemctl enable crond
crontab -e
*/5 * * * * /usr/sbin/ntpdate -u pool.ntp.org
git config --global user.name iotcat
git config --global user.email i@iotcat.me
# add local id_rsa.pub to github
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum install -y docker-ce docker-ce-cli containerd.io
systemctl start docker
systemctl enable docker
curl -L https://github.com/docker/compose/releases/download/1.25.4/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
sudo mkdir data
sudo mkdir log
sudo git clone --recursive git@github.com:IoTcat/ushio-share.git ~/share
sudo git clone -b xxx.yimian.xyz git@github.com:IoTcat/ushio-config.git ~/config
ssh-copy-id -p 2222 iotcat@usa.yimian.xyz
0 * * * * /usr/bin/rsync -az -e 'ssh -p 2222' iotcat@usa.yimian.xyz:~/secret /home/iotcat/
reboot