Linux 基础操作手记四

文章目录

          • 环境变量生效
          • 配置python版本
          • 安装SSH
          • 关闭GUI
          • vi 清空

环境变量生效

source ~/.bashrc # 或 source ~/.zshrc

配置python版本
sudo add-apt-repository ppa:deadsnakes/ppa
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.8 1
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 2
sudo update-alternatives --config python

Linux 基础操作手记四_第1张图片
python -V
在这里插入图片描述

安装SSH

检测ssh
systemctl status ssh
在这里插入图片描述
安装SSH
sudo apt install openssh-server

再次启动
systemctl status ssh
Linux 基础操作手记四_第2张图片

查看IP
hostname -I

检测服务开启
ping 192.168.195.128

登录
ssh [email protected] -p 22

编辑端口
gedit /etc/ssh/sshd_config

方式二

  1. VMWare虚拟机SSH配置
    Linux 基础操作手记四_第3张图片
  2. 连接
    Linux 基础操作手记四_第4张图片
关闭GUI

关闭用户图形界面,使用tty登录。

sudo systemctl set-default multi-user.target
sudo reboot

开启用户图形界面。

sudo systemctl set-default graphical.target
sudo reboot

内存对比
左边GUI开启时,占用3.5G,实际使用会到7G左右
右边关闭时只占用了
Linux 基础操作手记四_第5张图片

vi 清空

:.,$d

https://sysin.org/blog/ubuntu-remove-snap/

你可能感兴趣的:(Linux,linux,运维,服务器)