-
常规配置
yum源配置:
最小化安装的方式默认没有yum模板,配置过程如下:
[root@localhost ~]# mount /dev/cdrom /root/iso/ (挂载镜像) mount: /dev/sr0 写保护,将以只读方式挂载 简化客户端配置文件 [root@localhost ~]# yum-config-manager –add file:///root/iso/ 已加载插件:langpacks, product-id adding repo from: file:///root/iso/
[root_iso_] name=added from: file:///root/iso/ baseurl=file:///root/iso/ enabled=1
[root@localhost 桌面]#vim /etc/yum.conf (到此路径上把gpgcheck改为0,就是不用验证密钥) [main] cachedir=/var/cache/yum/$basearch/$releasever keepcache=0 debuglevel=2 logfile=/var/log/yum.log exactarch=1 obsoletes=1 gpgcheck=0(把这改为0,取消密钥验证) plugins=1 installonly_limit=3
[root@localhost ~]# yum clean all (清理缓存) 已加载插件:langpacks, product-id, search-disabled-repos, subscription-manager This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. 正在清理软件源: root_iso_ Cleaning up everything [root@localhost ~]# yum repolist (重新加载yum) 已加载插件:langpacks, product-id, search-disabled-repos, subscription-manager This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. root_iso_ | 4.1 kB 00:00:00 (1/2): root_iso_/group_gz | 136 kB 00:00:00 (2/2): root_iso_/primary_db | 3.6 MB 00:00:00 源标识 源名称 状态 root_iso_ added from: file:///root/iso/ 4,620 repolist: 4,620
安装常用命令:
1.安装ifconfig命令 yum install -y net-tools 2.安装unzip yum install -y unzip
防火墙管理:
查看防火墙状态: systemctl status firewalld
临时关闭防火墙命令: systemctl stop firewalld
永久关闭防火墙命令: systemctl disable firewalld
临时开启防火墙命令:
systemctl start firewalld
永久开启防火墙命令: systemctl enable firewalld
开放端口 firewall-cmd –add-port=80/tcp
更改用户密码:
方式一: 执行命令,passwd 用户名,然后根据提示输入密码
方式二: echo 密码|passwd –stdin 用户名
文件传输命令:
1.查看是否安装lrzsz rpm -qa | grep lrzsz
2.安装lrzsz yum install lrzsz -y
3.使用用lrzsz传输文件 rz
ps:除了使用命令方式传输文件外,还可以使用工具如winscp,xshell带的xftp,putty带的psftp等等工具。
安装配置VNC服务:
1.接入光盘,并挂载到系统目录下 mkdir -p /mnt/cdrom mount /dev/cdrom /mnt/cdrom 2.进入Package目录,并通过rpm命令安装vncserver cd Package rpm -ivh tigervnc-server-1.8.0-13.el7.x86_64.rpm 3.拷贝VNC配置文件,并对新的配置文件进行修改 cd /lib/systemd/system cp vncserver@.service vncserver@:1.service 按a进入到编辑模式,将<USER>位置替换为自己系统的用户名(root) 修改前: [Unit] Description=Remote desktop service (VNC) After=syslog.target network.target
[Service] Type=forking # Clean any existing files in /tmp/.X11-unix environment ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :' ExecStart=/usr/sbin/runuser -l <USER> -c "/usr/bin/vncserver %i" PIDFile=/home/<USER>/.vnc/%H%i.pid ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
[Install] WantedBy=multi-user.target
修改后: [Unit] Description=Remote desktop service (VNC) After=syslog.target network.target
[Service] Type=forking # Clean any existing files in /tmp/.X11-unix environment ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :' ExecStart=/usr/sbin/runuser -l root -c "/usr/bin/vncserver %i -geometry 1376×730" PIDFile=/home/root/.vnc/%H%i.pid ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
[Install] WantedBy=multi-user.target 4.更新systemd systemctl daemon-reload 5.设置vnc用户密码 vncpasswd root 6.启动vnc服务 vncserver :1 7.永久开启服务 systemctl enable vncserver@:1.service 8.配置防火墙规则 firewall-cmd –permanent –zone=public –add-port=5901/tcp firewall-cmd –reload
-
FTP服务器搭建
1.执行rpm -qa | grep vsftpd命令查看ftp服务是否安装
2.没安装,执行yum install -y vsftpd
3.已安装,执行systemctl start vsftpd启动服务
4.将ftp服务设为开机启动方法:执行setup命令,找到并将vsftpd服务设为开机自启动
5.配置文件位置:/etc/vsftpd/vsftpd.conf
6.配置完重启ftp服务,systemctl restart vsftpd
7.文件目录位置:/var/ftp/pub
8.给pub授予权限,chmod 777 pub
评论前必须登录!
注册