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.

77 lines
1.9 KiB

2 years ago
hostname xxx.yimian.xyz
hostnamectl set-hostname xxx.yimian.xyz
2 years ago
$ vi /etc/systemd/logind.conf
2 years ago
HandleLidSwitch=ignore
2 years ago
$ systemctl restart systemd-logind
2 years ago
# $ vi /etc/sysconfig/network-scripts/ifcfg-enp1s0
2 years ago
2 years ago
#/etc/passwd
2 years ago
iotcat:x:1000:1000::/home/iotcat:/bin/bash
2 years ago
#ushio:x:1001:1001::/home/ushio:/sbin/nologin
2 years ago
2 years ago
$ visudo
2 years ago
Defaults rootpw
2 years ago
#Defaults:ushio !rootpw
2 years ago
iotcat ALL=(ALL) ALL
2 years ago
#ushio ALL=(ushio) ALL
# $ passwd -d ushio
#/etc/ssh/sshd_config
PermitRootLogin no
2 years ago
Port 2222
2 years ago
$ 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
2 years ago
2 years ago
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
2 years ago
yum install -y wget git vim screen ntp
2 years ago
# enable ntp
systemctl start ntpd
systemctl enable ntpd
systemctl start crond
systemctl enable crond
crontab -e
2 years ago
*/5 * * * * /usr/sbin/ntpdate -u pool.ntp.org
2 years ago
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
2 years ago
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum install -y docker-ce docker-ce-cli containerd.io
2 years ago
systemctl start docker
systemctl enable docker
2 years ago
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
2 years ago
2 years ago
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
2 years ago
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/
2 years ago
reboot