Ubuntu 新装配置
[TOC]
Ubuntu 新装配置
一、配置apt源
1、备份ubuntu
mv /etc/apt/sources.list /etc/apt/sources.list.bak
2、配置清华源
su root cat > /etc/apt/sources.list <<EOF deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse EOF
3、更新源
sudo apt-get update sudo apt-get upgrade -y
二、安装必要的软件
sudo apt-get install curl wget vim ssh -y
三、配置ssh
1、开启root远程登陆
vim /etc/ssh/sshd_config PermitRootLogin yes #取消注释
2、重启ssh服务
systemctl enable ssh systemctl start ssh
四、关闭ubuntu ssh连接时的欢迎信息
1、关闭这个主要是为了防止泄露一些系统信息
sudo sed -i ‘/pam_motd.so/ s/^/#/g‘ /etc/pam.d/sshd #就是为了注释下面两行,不让他们在现实开机信息 #session optional pam_motd.so motd=/run/motd.dynamic #session optional pam_motd.so noupdate
五、配置终端颜色
vim ~/.bashrc export PS1="\[\033[01;31m\]\u\[\033[00m\]@\[\033[01;32m\]\h\[\033[00m\][\[\033[01;33m\]\t\[\033[00m\]]:\[\033[01;34m\]\w\[\033[00m\]\n$ " #生效 source ~/.bashrc
相关推荐
projava 2020-11-14
WanKaShing 2020-11-12
airfish000 2020-09-11
tryfind 2020-09-14
yegen00 2020-09-10
kkaazz 2020-09-03
风语者 2020-09-02
BraveWangDev 2020-08-19
lichuanlong00 2020-08-15
gsl 2020-08-15
pandaphinex 2020-08-09
yhuihon 2020-08-09
CheNorton 2020-08-02
xiangqiao 2020-07-28
hpujsj 2020-07-26
hpujsj 2020-07-26
sshong 2020-07-19
BraveWangDev 2020-07-19
annan 2020-07-18