su root
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
cd /etc/apt
mv sources.list sources.list.bak
cat > sources.list <<EOF
deb https://mirrors.ustc.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
deb-src https://mirrors.ustc.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
deb https://mirrors.ustc.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
deb-src https://mirrors.ustc.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
deb https://mirrors.ustc.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
deb-src https://mirrors.ustc.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
deb https://mirrors.ustc.edu.cn/debian-security/ bookworm-security main contrib non-free non-free-firmware
deb-src https://mirrors.ustc.edu.cn/debian-security/ bookworm-security main contrib non-free non-free-firmware
EOF
apt update
apt upgrade
|
1
2
3
4
|
apt install sudo
adduser henry
nano /etc/sudoers # henry ALL=(ALL:ALL) ALL
passwd password
|
su henry
1
2
3
|
sudo apt-get install zhcon
sudo adduser $(whoami) video
echo "alias zh='zhcon --utf8'" >> ~/.bashrc
|
touch .bash_profile
1
2
3
4
5
|
git clone https://github.com/tmux/tmux.git
cd tmux
sh autogen.sh
./configure && make
sudo make install
|
touch ~/.tmux.conf
source ~/.tmux.conf
1
2
|
sudo 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 -)"
|
source ~/.zshrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
sudo apt install rsync
sudo cp /usr/share/doc/rsync/examples/rsyncd.conf /etc/
sudo nano /etc/rsyncd.conf
# 修改以下:
# [website]
# path = /www/website
# read only = no
# uid = henry
# gid = henry
# 添加以下:(否则从windows同步过去权限会变为000)
# incoming chmod = Du=rwx,Dog=rx,Fu=rwx,Fgo=rx
sudo systemctl start rsync
|
in /etc/default/grub change the GRUB_CMDLINE_LINUX parameter to
GRUB_CMDLINE_LINUX=“quiet console=tty0 console=ttyS0,115200”
update-grub
dpkg-reconfigure exim4-config
- 选择"mail sent by smarthost; received via SMTP or fetchmail"选项;
- 将"System mail name:“设置为“localhost”;
- 设置"IP-addresses to listen on for incoming SMTP connections"为"127.0.0.1"来拒绝外部的连接;
- 不要填写"Other destinations for which mail is accepted:“选项,值留空;
- 也不要"Machines to relay mail for:“选项,值留空;
- 设置"IP address or host name of the outgoing smarthost:“的值为"smtp.163.com:25”;
- 设置"Hide local mail name in outgoing mail?“的值为“NO"选项;
- 设置"Keep number of DNS-queries minimal (Dial-on-Demand)?“的值为”NO“选项;
- 设置"Delivery method for local mail"的值为"mbox format in /var/mail/“选项;
- 设置"Split configuration into small files?“的值为"YES"选项;
- 设置”Root and postmaster mail recipient:“的值为空,不需要填写;
1
|
smtp.163.com:email.163.com:password # 它的结构为<163的SMTP服务器地址>:<发件人邮箱地址>:<邮箱授权码>
|
1
2
|
root: email.163.com # 否则系统会告诉你发件人帐号与发件人不符合
henry: email.163.com
|
systemctl restart exim4.service
echo "Email test body" | mail -s "Email test subject" email.163.com
root: email.163.com
newaliases
echo "Email test body" | mail -s "Email test subject" root
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
su root
mkdir -p /etc/pki/nssdb
echo -n | openssl s_client -connect smtp.163.com:465 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /etc/pki/nssdb/163.crt
certutil -A -n "GeoTrust SSL CA" -t "C,," -d /etc/pki/nssdb/ -i /etc/pki/nssdb/163.crt
certutil -A -n "GeoTrust Global CA" -t "C,," -d /etc/pki/nssdb/ -i /etc/pki/nssdb/163.crt
certutil -A -n "GeoTrust SSL CA - G3" -t "Pu,Pu,Pu" -d /etc/pki/nssdb/ -i /etc/pki/nssdb/163.crt
certutil -L -d /etc/pki/nssdb/
cat >> /etc/mail.rc <<EOF
set from=email.163.com
set smtp=smtps://smtp.163.com:465
set smtp-auth-user=email.163.com
set smtp-auth-password=password
set smtp-auth=login
set ssl-verify=ignore
set nss-config-dir=/etc/pki/nssdb
EOF
nano /etc/exim4/update-exim4.conf.conf # dc_eximconfig_configtype='internet'
/etc/init.d/exim4 restart
echo " 邮件正文内容 " | mail -v -s " 邮件主题 " email.163.com
|