SSH 远程访问
把密钥从本机(windows)拷贝到远程机
cat ~/.ssh/id_rsa.pub | ssh dev@192.168.1.113 "cat >> ~/.ssh/authorized_keys"
Linux 或 MacOS用户直接使用 ssh-copy-id :
ssh-copy-id -i ~/.ssh/id_rsa.pub dev@192.168.1.113
root 远程访问
Debian系默认禁止以root用户的身份通过ssh远程访问,我们自然不需要考虑这种安全问题。
sudo vim /etc/ssh/sshd_config
将PermitRootLogin注释去掉,改为yes
PermitRootLogin yes
systemctl restart ssh
Docker
https://mirrors.tuna.tsinghua.edu.cn/help/docker-ce/
oh-my-zsh
安装
安装zsh
sudo apt install zsh -y
下载oh-my-zsh GitHub安装包
sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
码云
wget https://gitee.com/mirrors/oh-my-zsh/raw/master/tools/install.sh编辑install.sh,改成 REPO=${REPO:-mirrors/oh-my-zsh} REMOTE=${REMOTE:-https://gitee.com/${REPO}.git} 编辑后保存, 运行安装即可. (运行前先给install.sh权限)
插件
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlightinggit clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
starship
curl -fsSL https://starship.rs/install.sh | bash
autojump
sudo apt install autojump
修改~/.zshrc
plugins=(zsh-syntax-highlightingzsh-autosuggestionsgitextractautojump)
启用starship文件末尾:
eval "$(starship init zsh)"
卸载oh-my-zsh
执行下面命令,重启终端
uninstall_oh_my_zsh
取消合盖休眠
笔记本会合盖睡眠,为了能够长期稳定运行,关闭合盖睡眠功能。
配置盖子电源设置:
- 打开/etc/systemd/logind.conf文件进行编辑。
将该行更改为以下所需的设置之一:
- HandleLidSwitch=poweroff 关闭盖子时关闭计算机
- HandleLidSwitch=hibernate 在合上盖子时到休眠计算机
- HandleLidSwitch=suspend 关闭盖子时暂停计算机
- HandleLidSwitch=ignore 不执行任何操作
HandleLidSwitch=ignore
保存文件,然后重新启动服务应用更改
systemctl restart systemd-logind
Not Recommend
下面这种方式会导致服务器自动在
/var/log/auth.log写入大量日志,塞满空间,禁止使用🙅sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.targethibernate.target hybrid-sleep.target
禁用Nvidia显卡
sudo vim /etc/default/grub
在
GRUB_CMDLINE_LINUX_DEFAULT最后添加nouveau.modeset=0GRUB_CMDLINE_LINUX_DEFAULT="nouveau.modeset=0"
执行以下命令:
sudo update-grubsudo apt-get purge nvidia*sudo reboot
虚拟显示器
sudo apt-get install xserver-xorg-core-hwe-18.04sudo apt-get install xserver-xorg-video-dummy-hwe-18.04 --fix-missing
sudo vim /usr/share/X11/xorg.conf.d/xorg.conf
Section "Monitor"Identifier "Monitor0"HorizSync 28.0-80.0VertRefresh 48.0-75.0# https://arachnoid.com/modelines/# 1920x1080 @ 60.00 Hz (GTF) hsync: 67.08 kHz; pclk: 172.80 MHzModeline "1920x1080_60.00" 172.80 1920 2040 2248 2576 1080 1081 1084 1118 -HSync +VsyncEndSectionSection "Device"Identifier "Card0"Driver "dummy"VideoRam 256000EndSectionSection "Screen"DefaultDepth 24Identifier "Screen0"Device "Card0"Monitor "Monitor0"SubSection "Display"Depth 24Modes "1920x1080_60.00"EndSubSectionEndSection
