本站地址:https://tenyon.cn
Linux
登录
立刻重启
shutdown -r now登录管理员
su root查看 ip
ip addr show网络
修改 dphc
vi /etc/sysconfig/network-scripts/ifcfg -e +tap重启网络
service network restart 172.16.176.143查看网络 端口
netstat -an | more防火墙
开启防火墙
systemctl start firewalld防火墙状态
systemctl status firewalld停止防火墙
systemctl stop firewalld.service禁止防火墙开机启动
systemctl disable firewalld.serviceSSH 服务
ps:_ssh 连接后可以在 ip1 下面连接 ip2 然后 exit 退出
启动 ssh 服务
systemctl start sshd.service关闭 ssh 服务
systemctl stop sshd.service重启 ssh 服务
systemctl enable sshd.service开机启动 ssh 服务
systemctl enable sshd.service授权
ps:-r 可读 4-w 可写 2-x 可执行 1 用二进制表示的 user group other 三组
完全公开
chown nobody:nobody xxx.txt完全公开文件夹
chown -R nobody:nobody test授权文件
chmod 777 bbb授权文件夹
chmod -R 777 test安装软件
解压缩文件
tar -xvf xxx.tar.gz安装单个
rpm -ivh xxx.rpm安装全部
rpm -ivh *.rpm force安装 bin 包
./xxxxx.bin其他
yum install docker
yum install nginx性能
cpu性能
cat /proc/cpuinfo| grep "cpu"cpu使用率
yum install epel-release yum install htop
top磁盘空间
df -h网络
iftopip
yum install net-tools
ifconfig查看所有进程/某个进程
ps -ef |grep xxx进程信息放到txt中
>>重定向符号
ps -ef >>a.txt仅仅查看
cat a.txt数据库
创建
CREATE USER 'yovvis'@'localhost' IDENTIFIED BY 'yovvis666';修改root密码
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '新密码';
FLUSH PRIVILEGES;授权
mysql> grant all privileges on *.* to 'tenyon'@'%';
SHOW GRANTS FOR 'tenyon'@'%';脱敏
-- 姓名
update userinfo SET username = rpad(substring(username, 1, 1 ), char_length(username), '*' ) where 1=1-- 电话
update userinfo SET username = CONCAT(LEFT (username, 3 ), '****' ,RIGHT(username,4)) where 1=1-- 单位
update ouinfo SET ouname = REPLACE (ouname, SUBSTRING(ouname,1,2),'**' ) WHERE ouname regexp '市'-- 查看脱敏后的用户名(不修改原数据)
SELECT
username,
IFNULL(
CONCAT(
SUBSTRING(username, 1, CHAR_LENGTH(username) - 1),
'一'
),
username
) AS 脱敏后用户名
FROM 你的表名;
-- 直接修改表中数据(谨慎使用)
UPDATE 你的表名
SET username = IFNULL(
CONCAT(
SUBSTRING(username, 1, CHAR_LENGTH(username) - 1),
'一'
),
username
)
WHERE username IS NOT NULL AND username != '';