目录

新建VPS安装记录

目录

新建VPS安装记录

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
timedatectl # 显示时区
timedatectl set-timezone Asia/Shanghai

## sudo & user
apt install sudo
adduser henry
tee /etc/sudoers.d/henry <<< 'henry ALL=(ALL) ALL'
chmod 440 /etc/sudoers.d/henry
passwd password

## 以下均使用root用户 ##
## 安装zsh
apt-get install qemu-guest-agent git curl zsh automake autoconf pkg-config gcc libevent-dev ncurses-dev make byacc bsd-mailx libnss3-tools -y
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"

git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

nano .zshrc --->
ZSH_THEME="ys"

plugins=(git 
extract 
z 
gitignore 
sudo
zsh-syntax-highlighting 
zsh-autosuggestions
tmux
)

# 禁止匹配*号等字符
setopt nonomatch

# 解决enter有时不能用
bindkey -s "^[OM" "^M"

# alias for docker
alias dk="docker"
alias dkre='dkrefn() { docker restart $1 && docker logs -f --tail 10 $1; }; dkrefn'
alias dkrm='dkrmfn() { docker stop $1 && docker rm $1; }; dkrmfn'
alias dkrmi='docker rmi'
alias dkup='dkupfn() { docker start $1 && docker logs -f --tail 10 $1; }; dkupfn'
alias dkrun="docker run -it"
alias dkrum="docker run -it --rm"
alias dkexe="docker exec -it"
alias dkpsa="docker ps -a"
alias dkps="docker ps"
alias dklg="docker logs --tail 200"
alias dklgf="docker logs -f --tail 10"
alias dkimg="docker images"
alias dkimp='docker image prune'
<---

apt install rsync
cp /usr/share/doc/rsync/examples/rsyncd.conf /etc/
nano /etc/rsyncd.conf

apt-get install net-tools

# 修改以下:
[website]
path = /www/website
read only = no
uid = henry
gid = henry
# 添加以下:(否则从windows同步过去权限会变为000)
incoming chmod = Du=rwx,Dog=rx,Fu=rwx,Fgo=rx

systemctl start rsync

bash <(curl -s -L https://git.io/v2ray.sh)