yum源:https://www.cnblogs.com/guanbin-529/p/11980400.html

163源:http://mirrors.163.com/centos/7/os/x86_64/Packages/

安装mysql:https://blog.csdn.net/qq_36582604/article/details/80526287

centos7-tomcat安装配置:https://blog.csdn.net/l568646976/article/details/92099264

远程文件SCP问题:https://jingyan.baidu.com/article/14bd256e1f20dffb6d2612c0.html

远程桌面:https://blog.csdn.net/u014296316/article/details/88257614

xshell密钥登入:https://blog.csdn.net/yuexiazhufeng/article/details/75349724
查看防火墙的状态的命令为:sudo systemctl status firewalld
打开防火墙的方式有两种,一种是打开后重启会恢复回原来的状态,命令为:
sudo systemctl start firewalld;另一种是打开后重启不会恢复到原来的状态,命令为:
sudo systemctl enable firewalld,这种方式输入命令后要重启系统才会生效。
关闭防火墙的方式也有两种,和打开相对应,命令分别为
sudo systemctl stop firewalld
sudo systemctl disable firewalld

获取公网IP地址:curl http://metadata.tencentyun.com/meta-data/public-ipv4

防火墙问题:https://blog.csdn.net/centose/article/details/96975849

CentOS 7.0默认使用的是firewall作为防火墙,之前版本是使用iptables。

1.设置firewall开机启动

systemctl enable firewalld

2.禁止firewall开机启动

systemctl disable firewalld

  1. 之前在本地的CentOS虚拟机上配置 Samba 服务器没有遇到过这种问题,
  2. 刚才在我的阿里云服务器上配置Samba上下文时, 报出了这个错误
  3. chcon -t samba_share_t /home/suozhiyuan/
  4. chcon: can't apply partial context to unlabeled file '/home/suozhiyuan/'
  5. 找了很久的资料, 发现问题是出在 selinux 放火墙上, 这个防火墙的配置文件为 /etc/selinux/config
  6. 配置内容:
  7. 原来是关闭: SELINUX=disabled
  8. 改成打开:  SELINUX=enforcing
  9. 复制代码
  10. # This file controls the state of SELinux on the system.
  11. # SELINUX= can take one of these three values:
  12. # enforcing - SELinux security policy is enforced.
  13. # permissive - SELinux prints warnings instead of enforcing.
  14. # disabled - No SELinux policy is loaded.
  15. #改成
  16. SELINUX=enforcing
  17. # SELINUXTYPE= can take one of these three values:
  18. # targeted - Targeted processes are protected,
  19. # minimum - Modification of targeted policy. Only selected processes are protected.
  20. # mls - Multi Level Security protection.
  21. SELINUXTYPE=targeted