文章目录
一、基础配置
1. 更新apt
sudo apt update
2. 设置密码
更改密码:
sudo passwd user
删除密码:
sudo passwd -d user
三. 安装C语言编译环境
sudo apt install gcc
sudo apt install build-essential
sudo apt install cmake
sudo apt install mingw-w64 # for cross compile
三. 重装python
安装python指令:
# install python
sudo apt install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get remove python3.8 # unistall old version, may install in when installing software-properties-common
sudo apt autoremove
sudo apt install python3.10
sudo ln -s /usr/bin/python3.10 /usr/bin/python3
# install pip
cd ~
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py
sudo python3 get-pip.py
四. 配置ssh
1. 创建密钥
mkdir ~/.ssh
cd ~/.ssh
ssh-keygen -t ed25519 -C "AddSomeComments"
git config --global user.name "YourName"
git config --global user.email "email@example.com"
2. 配置ssh-server
运行命令“sudo service ssh start”,若无法启动,输入下面的命令:
sudo ssh-keygen -A
sudo service ssh start
3. 配置sshd_config
文件位置:/etc/ssh/sshd_config
PermitRootLogin yes
PasswordAuthentication yes
PermitEmptyPasswords yes
4. 配置authorized_keys
编辑"~/.ssh/authorized_keys"文件,将远程访问的电脑的公钥复制到其中
若要为root配置,可将.ssh复制到"/root"目录中