linux 常用命令

//现有用户加到组

sudo usermod -a -G groupname username;

//添加用户到组

useradd -G {group-name} username

//修改目录所有者

chown -R www:www /public_html/*

//查看当前用户属于哪个组

groups

//给组加读写权限

chmod g+rw conf/*

//防火墙加规则 互相信任

sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="120.132.30.86" accept'

//加减端口

firewall-cmd --zone=public --add-port=22/tcp --permanent

firewall-cmd --zone=public --remove-port=22/tcp --permanent

firewall-cmd --permanent --add-port=8003/tcp

//查看防火墙端口情况

firewall-cmd --list-ports
posted @ 2017-09-14 14:45  快乐就好  阅读(209)  评论(0编辑  收藏  举报