新入系統要進行調整然後對各個部位進行整合
這樣會讓我們工作起來更加得心應手
登入提示語:
将提示語寫入/etc/motd 檔案
_ooOoo_
o8888888o
88" . "88
(| -_- |)
O\ = /O
____/`---'\____
.' \\| |// `.
/ \\||| : |||// \
/ _||||| -:- |||||- \
| | \\\ - /// | |
| \_| ''\---/'' | |
\ .-\__ `-` ___/-. /
___`. .' /--.--\ `. . __
."" '< `.___\_<|>_/___.' >'"".
| | : `- \`.;`\ _ /`;.`/ - ` : | |
\ \ `-. \_ __\ /__ _/ .-` / /
======
-.____
-.___\_____/___.-`____.-'======
`=---='
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
佛祖保佑 永不當機
2、上次登入資訊
修改/etc/ssh/sshd_config檔案,注意下面項目:
PrintMotd yes 預設顯示每日提示(/etc/motd)
PrintLastLog yes 預設顯示上次登入資訊
3、修改登入主目錄可以用不同的方法:
1)修改/etc/passwd,直接改掉使用者的主目錄
2)修改~/.bashrc或~/.bash_profile檔案,增加改變目錄的指令
改顔色(家目錄下)
[root@localhost ~]# vim .bashrc
.bashrc
User specific aliases and functions
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
PS1="[\e[33;40m][[\e[32;40m]\u[\e[31;40m]@\h [\e[33;40m]\w[\e[0m]]\$ "
Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
sentOS8 軟體源換成阿裡源
1、備份原來的源
1 cd /etc/yum.repos.d
2 cp CentOS-Linux-BaseOS.repo CentOS-BaseOS.repo.bak
-
下載下傳對應版本的repo檔案
wget -O CentOS-Base.repo
http://mirrors.aliyun.com/repo/Centos-8.repo
3、清除舊的yum緩存并生成新的yum緩存
1 yum clean all
2 yum makecache
如果不行删除yum目錄
1、設定新的yum目錄
mkdir /etc/yum.repos.d
2、 下載下傳配置(要區分自己的系統版本,不然肯定不通過)
CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo
http://mirrors.aliyun.com/repo/Centos-7.repoCentOS 8
3、清除檔案并重建中繼資料緩存
yum clean all
yum makecache
4、最後更新軟體包
yum update -y
亂碼檔案名删除步驟
[root@bogon /etc/yum.repos.d]# ls -i
2988265 CentOS-Base.repo
2983203 ''$'\222'']oװ'$'\257''8'$'\237\247\263''b^{'$'\266''LBCٝ'$'\207\330''k3rk2K'$'\314\337''V'$'\243\303''%'$'\226''ڨ'$'\344''V'$'\344\321''CX74Ⱥ'$'\246\270\326\354'
[root@bogon /etc/yum.repos.d]# find -inum 2983203 -delete
[root@bogon /etc/yum.repos.d]# ll
總用量 4
-rw-r--r--. 1 root root 2595 12月 26 2020 CentOS-Base.repo
本人還總結了海量Linux運維和安裝部署的問題,需要的話随時私聊我一下,可以技術交流,拒絕推銷賣貨!!!