第一部分
因为没有图形界面,在使用 Linux 服务器的过程中,我常常会觉得手打命令实在是太麻烦了,尤其是一些常用命令。
在发布这篇笔记之前,我都是收藏一大堆别人的命令汇总,等需要的时候打开浏览器,点开收藏夹,开始复制黏贴。
现在有了自己的博客网站,我想:为什么不能搞一个自己的命令汇总呢?
于是便有了这篇 “懒人是怎么使用电脑的?”。
第二部分
用于 DD 系统后的各种配置脚本
重装干净的 Linux 系统(DD 系统):
MoeClub 原版如下:
1
| bash <(wget --no-check-certificate -qO- 'https://raw.githubusercontent.com/MoeClub/Note/master/InstallNET.sh') -d 10 -v 64 -p "自定义root密码" -port "自定义ssh端口"
|
在原版命令中,-d 代表系统版本选择,-v 表示是 32 位或者 64 位,-p 可以自定义密码,-port 可自定义端口。比如按照提示,我可以修改成如下命令:
1
| bash <(wget --no-check-certificate -qO- 'https://raw.githubusercontent.com/MatthewJian/MoeClub-Note-Fork/master/InstallNET.sh') -d 11 -v 64 -p "<?5<V8u=J.r9" -port "22305"
|
重装完成后记得第一时间 passwd
修改密码,推荐直接修改配置文件使用 ssh 密钥登录。
修改登录端口、登录方式等 SSH 信息:
1
| nano /etc/ssh/sshd_config
|
关闭密码登录:找到 PasswordAuthentication
项,把 yes
改为 no
就可以,记得事先创建登录密钥。
重启 ssh 服务:输入命令 service sshd restart
或者直接重启服务器。
修改新的主机名:
安装新系统后安装必备应用:
1
| apt update && apt upgrade && apt install -y wget
|
1
| apt update && apt upgrade && apt install -y curl
|
删除保存在本地的 ssh 连接公钥:
1
| rm -rf ~/.ssh/known_hosts
|
添加新用户
新建用户:
1
| usermod -s /bin/bash 新用户名
|
应用程序安装
安装 Tar
1
| apt update && apt upgrade && apt install -y tar
|
安装 Node.js
1
| apt update && apt upgrade && apt install -y nodejs npm
|
宝塔海外版
1
| wget -O install.sh http://www.aapanel.com/script/install-ubuntu_6.0_en.sh && bash install.sh aapanel
|
1
| yum install -y wget && wget -O install.sh http://www.aapanel.com/script/install_6.0_en.sh && bash install.sh aapanel
|
安装 Hexo
安装配置 hexo
1 2
| cd /usr/bin ln -s /usr/local/bin/nodejs/lib/node_modules/hexo-cli/bin/hexo hexo
|
部署 hexo
1
| hexo clean && hexo g && hexo s
|
1
| hexo clean && hexo g && hexo d
|
国际物联网连接服务
详细内容可以看这篇博客。
卸载应用程序
1
| apt-get autoremove --purge 应用名
|