1.非root用户,sudo命令无法使用时(参考文件中的root用户写法) 需要在/etc/sudoers上加上 用户名 ALL=(ALL:ALL) ALL 2.centos查看占用端口并关闭 安装命令: sudo yum install lsof sudo lsof -i:端口 -P sudo kill -9 PID