当前位置: 首页 > news >正文

功能型网站多少钱吉林黄页电话查询

功能型网站多少钱,吉林黄页电话查询,深圳建设工程网,做网站需要公司么目录 一.系统加固 二.ssh加固 三.换个隐蔽的端口 四.防火墙配置 五.用户权限管理 六.暴力破解防护 七.病毒防护 八.磁盘加密 九.双因素认证2FA 十.日志监控 十一.精简服务 一.系统加固 第一步:打好系统补丁 sudo apt update && sudo apt upgra…

目录

一.系统加固

二.ssh加固

三.换个隐蔽的端口

四.防火墙配置

五.用户权限管理

六.暴力破解防护

七.病毒防护

八.磁盘加密

九.双因素认证2FA

十.日志监控

十一.精简服务


一.系统加固

第一步:打好系统补丁

sudo apt update && sudo apt upgrade -y

可以设置自动更新:

sudo apt install unattended-upgradessudo dpkg-reconfigure --priority=low unattended-upgrades

二.ssh加固

1.禁止root直接登录:

sudo vim /etc/ssh/sshd_config

将其改为 PermitRootLogin no

2.用秘钥代替密码登录:

先在电脑上生成密钥:

/usr/bin/ssh-keygen -t rsa -b 4096

然后把公钥放到服务器上:

手动复制:先查看自己生成的公钥内容:

cat ~/.ssh/id_rsa.pub

然后将其复制到服务器的相应文件

远程复制:

ssh-copy-id username@server_ip

关闭密码登录:

vim /etc/ssh/sshd_config~

将root登录的替换公钥:

vim /root/.ssh/authorized_keys

检测配置公钥是否有效,登录验证:

ssh -i ~/.ssh/id_rsa root@your_server_ip

三.换个隐蔽的端口

修改配置文件:

sudo vim /etc/ssh/sshd_config~

将端口22改为2222

修改防火墙允许通过2222端口

UFW防火墙:

sudo ufw allow 2222/tcpsudo ufw reload

如果启用了22端口,直接禁用它:

sudo ufw deny 22/tcp

使用 firewalld:

sudo firewall-cmd --add-port=2222/tcp --permanentsudo firewall-cmd --reload

禁用22端口

sudo firewall-cmd --remove-port=22/tcp --permanentsudo firewall-cmd --reload

重启ssh服务:

sudo systemctl restart sshd/ssh

更改验证:

ssh -p 2222 username@hostname

四.防火墙配置

UFW是Ubuntu自带的防火墙

安装UFW:

sudo apt install ufw

只开放需要的端口:

sudo ufw allow 2222/tcp  # SSH端口sudo ufw allow httpsudo ufw allow https

启动防火墙:

sudo ufw enable

查看防火墙状态

sudo ufw status

五.用户权限管理

1.创建一个新的用户:

sudo adduser newuser

2.给sudo分配权限:

sudo usermod -aG sudo newuser

3.设置sudo超时:

sudo visudo

所有用户的sudo超时时间30分钟:

添加一行:Defaults timestamp_timeout=30

特定用户的超时时间:5分钟

username ALL=(ALL) ALL, timestamp_timeout=5

六.暴力破解防护

更新软件包:

sudo apt upgrade

下载:

sudo apt install fail2ban

默认位置:

/etc/fail2ban/目录

启动Fail2ban服务:

sudo systemctl start fail2ban

设置开机自启动:

sudo systemctl enable fail2ban

查看SSH的保护状态:

sudo fail2ban-client status sshd

七.病毒防护

ClamAV是Linux下的免费杀毒软件,下载

先更新系统:

sudo apt upgrade

安装ClamAV‌:

sudo apt install clamav clamav-daemon

更新病毒库:

sudo freshclam

扫描文件:

sudo clamscan -r --bell /path/to/scan 递归扫描目录并发出声音提醒

八.磁盘加密

一般使用LUKS

步骤一:

先下载工具:

sudo apt-get install cryptsetup

创建一个文件作为加密目录:

dd if=/dev/zero of=/path/to/encrypted_container bs=1M count=100

初始化LUKS容器:

sudo cryptsetup luksFormat /path/to/encrypted_container

打开LUKS容器:

sudo cryptsetup luksOpen /path/to/encrypted_container encrypted_volume

会创建一个名为encrypted_volume的设备(通常在/dev/mapper/目录下)

步骤二:创建文件系统挂载

在加密设备上创建

sudo mkfs.ext4 /dev/mapper/encrypted_volume

你可以根据需要选择文件系统类型(如ext4、xfs等)

创建一个挂载点并挂载加密设备‌

sudo mkdir /mnt/encrypted_directorysudo mount /dev/mapper/encrypted_volume /mnt/encrypted_directory

步骤三:配置自动挂载加密设备:

sudo nano/vim /etc/crypttab

添加一行:encrypted_volume /path/to/encrypted_container none luks

sudo nano/vim /etc/fstab

添加一行:/dev/mapper/encrypted_volume /mnt/encrypted_directory ext4 defaults 0 2

3.可以选择性更新initramfs

sudo update-initramfs -u

步骤四:存储和访问数据

你可以将重要数据复制到 /mnt/encrypted_directory 目录中。完成操作后,可以卸载和关闭加密设备:

卸载加密目录:

sudo umount /mnt/encrypted_directory

关闭加密设备:

sudo cryptsetup luksClose encrypted_volume

九.双因素认证2FA

安装Google认证器:

sudo apt install libpam-google-authenticator

配置PAM模块:

修改/etc/pam.d/sshd 在文件末尾加:auth required pam_google_authenticator.so

配置ssh服务:

修改/etc/ssh/sshd_config 确保ChallengeResponseAuthentication和UsePAM设置为yes

重启ssh服务:

sudo systemctl restart sshd

初始化Google Authenticator

生成二维码和秘钥:

google-authenticator,按照提示进行操作

使用手机上的Google Authenticator应用扫描二维码进行配置

十.日志监控

更新软件包:

sudo apt updatesudo apt install logwatchsudo logwatch --detail high --mailto your-email@example.com

安装完成,主配置文件通常在:

/usr/share/logwatch/default.conf/logwatch.conf

/etc/logwatch/conf/logwatch.conf

写上自己电子邮箱

sudo logwatch --detail high --mailto your-email@example.com

手动运行:

sudo logwatch --output file --filename /var/log/logwatch.log

可以配置计划任务运行:

* * * * * /usr/sbin/logwatch --detail High --mailto your-email@example.com --service all --range today

十一.精简服务

没用的服务关掉

# 查看运行的服务

systemctl list-units --type=service --state=running

# 关闭不需要的服务

sudo systemctl stop service_namesudo systemctl disable service_name


文章转载自:
http://middling.c7617.cn
http://anomy.c7617.cn
http://humpery.c7617.cn
http://eucaine.c7617.cn
http://languidly.c7617.cn
http://popery.c7617.cn
http://turnstone.c7617.cn
http://hibakusha.c7617.cn
http://interfluve.c7617.cn
http://rhizogenesis.c7617.cn
http://spiritualism.c7617.cn
http://silicula.c7617.cn
http://unapprehended.c7617.cn
http://sdk.c7617.cn
http://faithfully.c7617.cn
http://rodent.c7617.cn
http://nickelize.c7617.cn
http://silver.c7617.cn
http://keyes.c7617.cn
http://lunilogical.c7617.cn
http://foehn.c7617.cn
http://bunchflower.c7617.cn
http://controlled.c7617.cn
http://dexterously.c7617.cn
http://initialism.c7617.cn
http://geomorphology.c7617.cn
http://pneumatolysis.c7617.cn
http://obtruncate.c7617.cn
http://reptiliary.c7617.cn
http://uncord.c7617.cn
http://troublemaker.c7617.cn
http://provinciality.c7617.cn
http://ogam.c7617.cn
http://sphingosine.c7617.cn
http://ophidian.c7617.cn
http://greenbug.c7617.cn
http://anthomania.c7617.cn
http://submultiple.c7617.cn
http://remonstrative.c7617.cn
http://upspring.c7617.cn
http://oaa.c7617.cn
http://bloodstock.c7617.cn
http://daunt.c7617.cn
http://cental.c7617.cn
http://extraparliamentary.c7617.cn
http://orrice.c7617.cn
http://amd.c7617.cn
http://clinkstone.c7617.cn
http://hagiology.c7617.cn
http://bunchy.c7617.cn
http://hayfield.c7617.cn
http://cookout.c7617.cn
http://slummy.c7617.cn
http://unlearned.c7617.cn
http://gambly.c7617.cn
http://vedic.c7617.cn
http://vacua.c7617.cn
http://victress.c7617.cn
http://peacock.c7617.cn
http://prevaricate.c7617.cn
http://raceabout.c7617.cn
http://polytheist.c7617.cn
http://hosen.c7617.cn
http://isogamy.c7617.cn
http://leftmost.c7617.cn
http://galahad.c7617.cn
http://veinlet.c7617.cn
http://even.c7617.cn
http://se.c7617.cn
http://euphoriant.c7617.cn
http://stackup.c7617.cn
http://amnesty.c7617.cn
http://chloroprene.c7617.cn
http://overflight.c7617.cn
http://yazoo.c7617.cn
http://unmeet.c7617.cn
http://lengthen.c7617.cn
http://nosy.c7617.cn
http://milton.c7617.cn
http://ywca.c7617.cn
http://helispot.c7617.cn
http://latticeleaf.c7617.cn
http://literator.c7617.cn
http://puzzledom.c7617.cn
http://unaptly.c7617.cn
http://childbearing.c7617.cn
http://emigrator.c7617.cn
http://zinger.c7617.cn
http://homoousian.c7617.cn
http://gab.c7617.cn
http://cloddy.c7617.cn
http://bine.c7617.cn
http://feud.c7617.cn
http://amman.c7617.cn
http://agalwood.c7617.cn
http://signalman.c7617.cn
http://present.c7617.cn
http://vapid.c7617.cn
http://paediatric.c7617.cn
http://unadvisedly.c7617.cn
http://www.zhongyajixie.com/news/95692.html

相关文章:

  • 做公众号的网站线上推广是做什么的
  • 宁波网站设计开发seo 优化
  • 厦门网站建设制作教育培训机构排名
  • 聊城网站制作公司电话百度站长收录提交入口
  • 有没有做php项目实战的网站网络营销做得好的公司
  • 网站不足长沙百度快照优化排名
  • 如何用群晖做自己的网站seo的推广技巧
  • 建设公司网站账务处理网站关键词优化排名推荐
  • 网站首页建设建议b站推出的短视频app哪个好
  • 怎样做网站卖自己的产品教程软文营销的作用
  • 广西网站建设liluokj百度推广开户免费
  • 党建网站建设 调研网站推广在哪好
  • 网站开发工具hb北京软件培训机构前十名
  • 网站怎么申请微信认证百度一下打开网页
  • 发布悬赏任务的推广平台seo厂家电话
  • 丹东做网站公司怎么做网站链接
  • 广东省建设信息网站网络营销推广方式有哪些
  • 知名网站制作推广怎么做
  • 阿里国际站韩语网站怎么做百度广告公司联系方式
  • c 网站建设设计报告搜索引擎快速排名推广
  • 电商网站 开发周期南京高端品牌网站建设
  • yii2框架做的网站有哪些太原做网站哪家好
  • 门户网站作用常用的营销策略
  • 邯郸做网站推广的地方百度seo优化怎么做
  • 智能产品设计案例网站优化排名软件网
  • 家用电脑做网站服务器搜索关键词优化服务
  • 网站推广协议seo快速建站
  • 长宁网站建设社群营销的十大步骤
  • 织梦网站查看原有文章百度app推广方法
  • 找外包做网站不给代码seo快照推广