查看: 19|回覆: 0

[Fedora] 简单配置项

[複製鏈接]

1

主題

0

回帖

0

積分

热心网友

金币
0
閲讀權限
220
精華
0
威望
0
贡献
0
在線時間
0 小時
註冊時間
2011-12-11
發表於 2023-8-8 18:10:00 | 顯示全部樓層 |閲讀模式

Fedora

   是一个Linux发行版,是一款由全球社区爱好者构建的面向日常应用的快速、稳定、强大的操作系统。它允许任何人自由地使用、修改和重发布,目标是创建一套新颖、多功能并且自由的操作系统。

相关仓库

  • Fedora其他架构源(fedora-altarch):https://developer.aliyun.com/mirror/fedora-altarch
  • Fedora第三方源(fedora-alt):https://developer.aliyun.com/mirror/fedora-alt

1. 备份

mv /etc/yum.repos.d/fedora.repo /etc/yum.repos.d/fedora.repo.backup
mv /etc/yum.repos.d/fedora-updates.repo /etc/yum.repos.d/fedora-updates.repo.backup

2. 下载新的 fedora.repo 和 fedora-updates.repo 到 /etc/yum.repos.d/

fedora

wget -O /etc/yum.repos.d/fedora.repo http://mirrors.aliyun.com/repo/fedora.repo

或者

curl -o /etc/yum.repos.d/fedora.repo http://mirrors.aliyun.com/repo/fedora.repo

fedora updates

wget -O /etc/yum.repos.d/fedora-updates.repo http://mirrors.aliyun.com/repo/fedora-updates.repo

或者

curl -o /etc/yum.repos.d/fedora-updates.repo http://mirrors.aliyun.com/repo/fedora-updates.repo

3. 运行 sudo yum makecache 生成缓存

主机名设置
su vi /etc/hostname
SSH 远程连接配置

1. 放开22端口

iptables -A INPUT -p tcp --dport 22 -j ACCEPT(这句很重要,不然外部连接不了。)

2. 启动SSH服务

service sshd start  

systemctl start sshd

3. 开机启动设置

systemctl enable sshd.service

4. 允许root可以登录

vi /etc/ssh/sshd_config

搜索 PermitRootLogin
vi vim 一般模式下斜杠向下搜素 /PermitRootLogin 或 问号向上搜索 ?PermitRootLogin
找到
#PermitRootLogin prohibit-password
将其改为
PermitRootLogin yes 或 新增一行

5. 重启SSH服务

systemctl restart sshd
 
防火墙配置
sudo systemctl stop firewalld.service         # 暂时关闭,重启后恢复
sudo systemctl start firewalld.service        # 启用防火墙
sudo systemctl disable firewalld.service      # 禁用防火墙
sudo systemctl enable firewalld.service       # 启用防火墙
sudo systemctl status firewalld.service       # 查看状态

  



来源:https://www.cnblogs.com/eRrsr/p/17615086.html
回覆

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 立即注册

本版積分規則

相关侵权、举报、投诉及建议等,请发 E-mail:qiongdian@foxmail.com

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部