2、Linux常用功能

防火墙的基本用法

- 启动: systemctl start firewalld

- 关闭: systemctl stop firewalld

- 查看状态: systemctl status firewalld 

- 开机禁用  :systemctl disable firewalld

- 开机启用  : systemctl enable firewalld

- 添加一个端口:firewall-cmd --zone=public --add-port=80/tcp --permanent    
(--permanent永久生效,没有此参数重启后失效)

- 重新载入:firewall-cmd --reload

- 查看端口:firewall-cmd --zone= public --query-port=80/tcp

- 删除规则:firewall-cmd --zone= public --remove-port=80/tcp --permanent

配置主机之间的免密ssh登陆?

挂载外部存储设备到文件系统中

mkdir   /mnt/cdrom      创建一个目录,用来挂载

mount -t iso9660 -o ro /dev/cdrom /mnt/cdrom/     --以只读的方式(-o ro :-option readonly)将设备/dev/cdrom挂载到 挂载点: /mnt/cdrom中

远程拷贝文件

scp -r /root/aa root@192.168.10.30:/root    --将本地文件夹aa拷贝到远程服务器192.168.10.30的root目录下

scp root@192.168.10.30:/root/index.html /home   --将远程服务器root目录下的index.html文件拷贝至本地/home目录

将windows文件拷贝到Linux虚拟机

1、在Linux中安装lrzsz工具包:yum install lrzsz

2、在xshell界面输入rz命令,选择文件


Centos安装FileZilla

1、首先要更新下rpmforge

sudo rpm -Uhv http://fedora.mirrors.pair.com/epel/6/i386/epel-release-6-8.noarch.rpm

2、安装filezilla

sudo yum install filezilla

查看端口占用情况

### sudo yum install net-tools
netstat -tunlp |grep 8000

CentOS7关闭SELinux

永久关闭

vi /etc/selinux/config
将SELINUX=enforcing改为SELINUX=disabled 
设置后需要重启才能生效

查询Yum安装过的包

yum list installed | grep docker

docker-engine.x86_64                 17.03.0.ce-1.el7.centos         @dockerrepo

卸载yum安装包

yum -y remove docker-engine.x86_64
posted @ 2018-08-20 14:28  巴克老队长  阅读(395)  评论(0编辑  收藏  举报