all can root/sudo
sudo su
passwd
to set pw=1
sshd
add ports in /etc/ssh/sshd_config:
ListenAddress 0.0.0.0:22
ListenAddress 0.0.0.0:5022
thenservice sshd restart
(won't break connected ssh).if "key exchange algorithm" not found:
append "diffie-hellman-group1-sha1" to "KexAlgorithms" in /etc/ssh/sshd_config
vnc for X
vnc4server(by realvnc) --> tightvnc -2009->tigervnc
tigervnc allow 1 char password.
ip, ports, connections
curl cip.cc
netstat -atpn
nmap IP -Pn -pNNN
or telnet IP NNN
PS1
item format \e[XXXm
, with XXX=0 to clear format.PS1='\e[1;33m\W \e[31m\# \e[0m'
ref https://misc.flogisoft.com/bash/tip_colors_and_formatting
from https://wiki.archlinux.org/title/Bash/Prompt_customization
repo for centos:
base repo, may use vault
https://mirrors.cloud.tencent.com/help/centos.html
https://developer.aliyun.com/mirror/centosepel repo
https://mirrors.cloud.tencent.com/help/epel.html
https://developer.aliyun.com/mirror/epelforge repo, ~5k pkgs for centos6
https://mirrors.cloud.tencent.com/help/repoforge.html
https://developer.aliyun.com/mirror/repoforgereleasever=$(rpm -E %centos)
basearch=$(rpm -E %_arch)
then copy-paste "cat > .repo" code,
ali:sed -i s:el7:el$releasever:g /etc/yum.repos.d/rpmforge.repo
fusion repo, ~300 pkgs for centos6
here yum may create two files: epel.repo.rpmnew, epel-testing.repoyum install --nogpgcheck http://mirrors.tencentyun.com/rpmfusion/free/el/rpmfusion-free-release-$(rpm -E %centos).noarch.rpm http://mirrors.tencentyun.com/rpmfusion/nonfree/el/rpmfusion-nonfree-release-$(rpm -E %centos).noarch.rpm
sed -i s#download1.rpmfusion.org#mirrors.tencentyun.com/rpmfusion#g /etc/yum.repos.d/rpmfusion-*.repo
yum install --nogpgcheck http://mirrors.cloud.aliyuncs.com/rpmfusion/free/el/rpmfusion-free-release-$(rpm -E %centos).noarch.rpm http://mirrors.cloud.aliyuncs.com/rpmfusion/nonfree/el/rpmfusion-nonfree-release-$(rpm -E %centos).noarch.rpm
sed -i s#download1.rpmfusion.org#mirrors.cloud.aliyuncs.com/rpmfusion#g /etc/yum.repos.d/rpmfusion-*.repo
sum for following
sed -i '/^\W*http/d; /^\W*mirrorlist/d; s/^\W*#\W*baseurl/baseurl/; s/https/http/g;' /etc/yum.repos.d/*.repo
this cmd can run multiple times without repeated replace.-
- remove alt baseurl
sed -i '/^\W*http/d' /etc/yum.repos.d/*.repo
- remove alt baseurl
-
- remove mirrorlist, use baseurl
sed -i '/^\W*mirrorlist/d' /etc/yum.repos.d/*.repo
sed -i 's/^\W*#\W*baseurl/baseurl/' /etc/yum.repos.d/*.repo
- remove mirrorlist, use baseurl
-
- https -> http
sed -i s/https/http/g /etc/yum.repos.d/*.repo
- https -> http
use private network:
mirrors.tencentyun.com
mirrors.cloud.aliyuncs.comsed -i 's/cloud\.tencent/tencentyun/g' /etc/yum.repos.d/*.repo
sed -i 's/aliyun\./cloud.aliyuncs./g' /etc/yum.repos.d/*.repo
this cmd can run multiple times without repeated replace.