Linux Basic Notes
Linux Boot System
Grub
Grub Configuration
/etc/default/grub
配置文件, 用于一些基本的修改项, 如默认启动项, Grub 界面等待时长, Grub 主题 etc. More details ininfo -f grub -n 'Simple configuration'
# Default Startup OS
GRUB_DEFAULT=0
# Default Timeout
GRUB_TIMEOUT=5
# https://github.com/vinceliuice/grub2-themes
GRUB_THEME="/boot/grub/themes/Tela/theme.txt"
/etc/grub.d/*
生成/boot/grub/grub.cfg
的执行脚本(update-grub
命令), 可以更细致地修改启动项, 如各个启动项的名称、顺序等.
Grub Repair
Windows Repair
- easyBCD for non-efi loader
- with efi loader, run command:
# root commander
bcdedit /set "{bootmgr}" path \EFI\ubuntu\grubx64.efi
Ubuntu Live Repair
sudo add-apt add-apt-repository ppa:yannubuntu/boot-repair
sudo apt update
sudo apt install boot-repair
boot-repair
重装 Linux
- 自动挂载项 /etc/fstab etc/rc.local
- 自定义脚本-新建目录(加入环境变量)
- 自定义别名 ~/.bashrc
SSH Commands
Key
ssh-keygen -t rsa
ssh-add ~/.ssh/id_rsa
SSHD
- config file in
/etc/ssh/sshd_config
sudo systemctl reload sshd
sudo service restart sshd
SSH Config File
~/.ssh/config
:
- Host 别名
- HostName 主机名(ip)
ssh user@ip
- Port 可忽略
- User 登录用户名
ssh user@ip
- PreferredAuthentications publicKey
- IdentityFile 密钥文件 完整路径
ssh -i file
- HostName 主机名(ip)
Host github.com
HostName github.com
PreferredAuthentications publicKey
IdentityFile ~/.ssh/id_rsa
Host cs.github.com
HostName github.com
PreferredAuthentications publicKey
IdentityFile ~/.ssh/cs
Host cloud
HostName xx.org
User root
IdentityFile ~/.ssh/dsl_private_key
Host bwg
HostName 23.106.150.152
User root
Port 29692
git clone git@github.com:user/repo
git clone git@cs.github.com:user/repo
ssh -qTfnN -D 7070 bwg
google-chrome socks5 127.0.0.1 7070