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

域名备案后网站打不开网页设计收费标准

域名备案后网站打不开,网页设计收费标准,wordpress for ace,秦皇岛网站制作报价现在用redis缓存热数据越来越常见了,甚至一些配置,开关等等的东西也写到redis里。原因就是redis简单高效。redis里的数据也越来越重要了,例如一些业务的中间数据会暂时存放在redis里,所以限制redis的访问还是很有必要。 本文通过…

现在用redis缓存热数据越来越常见了,甚至一些配置,开关等等的东西也写到redis里。原因就是redis简单高效。redis里的数据也越来越重要了,例如一些业务的中间数据会暂时存放在redis里,所以限制redis的访问还是很有必要。

本文通过几个手段说一下生产环境中redis的访问权限控制。

1、绑定网卡bind

redis的配置文件redis.conf中对于网络安全部分有这样一段话

复制代码

################################## NETWORK ###################################### By default, if no "bind" configuration directive is specified, Redis listens
# for connections from all the network interfaces available on the server.
# It is possible to listen to just one or multiple selected interfaces using
# the "bind" configuration directive, followed by one or more IP addresses.
#
# ~~~ WARNING ~~~ If the computer running Redis is directly exposed to the
# internet, binding to all the interfaces is dangerous and will expose the
# instance to everybody on the internet. So by default we uncomment the
# following bind directive, that will force Redis to listen only into
# the IPv4 lookback interface address (this means Redis will be able to
# accept connections only from clients running into the same computer it
# is running).

复制代码

这段话的意思道出了bind的深意:bind的意思是你的redis实例绑定在哪个interface上,可以理解成绑定在哪个网卡上。那么我们有几个网卡呢?可以看一下。

$ ifconfig 
eth0      Link encap:Ethernet  HWaddr 6C:92:BF:22:D7:FC  inet addr:10.93.84.53  Bcast:10.93.84.127  Mask:255.255.255.128lo        Link encap:Local Loopback  inet addr:127.0.0.1  Mask:255.0.0.0

这里就两个,一个是eth0以太网卡(10.93.84.53),一个是本地回路lo(127.0.0.1)。

那么会有这两种情况:

1) bind 10.93.84.53 #同一网段的所有主机都可以连接redis

2) bind 127.0.0.1 #本地回路,那么只有你redis实例所在的主机能访问redis

你可以根据你的需要进行使用:

1) 如果你的机器直接暴露给互联网,那么你还是慎重的将bind设置为127.0.0.1吧,否则你相当于暴露了你的redis给外部所有攻击。

2) 如果你再生产环境中,那么你一般会需要绑在网卡上,以便其他主机也能访问redis,那么我们会有一些其他的方式保证redis数据的安全。

2、设置密码requirepass

redis.conf里有这样的配置,设置了密码之后。

#requirepass <yourpassword>
requirepass mypass

重启redis服务后,你的客户端都需要通过密码的方式访问redis

# 密码正确
$ redis-cli -h 10.93.84.53 -p 6379 -a mypass ping
PONG
# 密码错误
$ redis-cli -h 10.93.84.53 -p 6379 -a hehe ping 
(error) NOAUTH Authentication required.

3、nologin降低账号权限

以较低权限账号运行Redis服务,且禁用该账号的登录权限。另外可以限制攻击者往敏感写入文件,但是Redis数据还是能被黑客访问到,或者被黑客恶意删除。

禁止Linux用户登录的方法,一般是修改用户的shell类型为/sbin/nologin
这种方式会更加人性化一点,因为不仅可以禁止用户登录,还可以在禁用登陆时给提示告诉它这么做的原因。
修改/etc/nologin.txt,没有的话就手动新建一个,在里面添加给被禁止用户的提示(这种方式的所有用户的锁定信息都在这个文件中,在登陆时给与提示)。

其实就是把/etc/passwd文件里的/bin/bash对应改成/sbin/nologin

复制代码

[root@host-192-168-1-117 ~]# useradd wangshibo
[root@host-192-168-1-117 ~]# echo "123456"|passwd --stdin wangshibo
Changing password for user wangshibo.
passwd: all authentication tokens updated successfully.
[root@host-192-168-1-117 ~]# cat /etc/passwd|grep wangshibo
wangshibo:x:500:500::/home/wangshibo:/bin/bash
[root@host-192-168-1-117 ~]# sed -i 's#/home/wangshibo:/bin/bash#/home/wangshibo:/sbin/nologin#g' /etc/passwd
[root@host-192-168-1-117 ~]# cat /etc/passwd|grep wangshibo
wangshibo:x:500:500::/home/wangshibo:/sbin/nologin[root@host-192-168-1-117 ~]# touch /etc/nologin.txt
[root@host-192-168-1-117 ~]# cat /etc/nologin.txt
In order to protect the system security, this type of user is locked!

复制代码

4、iptables设置防火墙

在生产环境中设置防火墙还是很有必要的。如果正常业务中Redis服务需要被其他服务器来访问,可以设置iptables策略仅允许指定的IP来访问Redis服务。

在你redis实例所在的主机,执行如下命令。

复制代码

# 查看iptables规则配置的规则
$ iptables -nL --line-number
# 禁止所有的主机访问本机6379端口
$ iptables -I INPUT -p TCP --dport 6379 -j DROP
# 打开如下的机器-s指定,这些机器可以访问本机的6379端口
$ iptables -I INPUT -s 10.93.21.21 -p tcp --dport 6379 -j ACCEPT
$ iptables -I INPUT -s 10.93.18.34 -p tcp --dport 6379 -j ACCEPT
$ iptables -I INPUT -s 10.93.18.35 -p tcp --dport 6379 -j ACCEPT
$ iptables -I INPUT -s 10.93.84.53 -p tcp --dport 6379 -j ACCEPT
# 保存iptables配置
$ service iptables save
iptables: Saving firewall rules to /etc/sysconfig/iptables:[  OK  ]
# 重启防火墙 
$ service iptables restart
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]
iptables: Flushing firewall rules:                         [  OK  ]
iptables: Unloading modules:                               [  OK  ]
iptables: Applying firewall rules:                         [  OK  ]

复制代码

设置成功后,只有配置的那四台机器可以访问redis实例。


文章转载自:
http://duricrust.hmxb.cn
http://specious.hmxb.cn
http://untomb.hmxb.cn
http://circumfluent.hmxb.cn
http://dysprosium.hmxb.cn
http://microheterogeneity.hmxb.cn
http://lockpin.hmxb.cn
http://complementarity.hmxb.cn
http://improperly.hmxb.cn
http://phaedra.hmxb.cn
http://seif.hmxb.cn
http://douai.hmxb.cn
http://liking.hmxb.cn
http://protechny.hmxb.cn
http://absorb.hmxb.cn
http://backbend.hmxb.cn
http://pronatalism.hmxb.cn
http://woodless.hmxb.cn
http://admittedly.hmxb.cn
http://annoyance.hmxb.cn
http://clap.hmxb.cn
http://cabman.hmxb.cn
http://pdh.hmxb.cn
http://larynx.hmxb.cn
http://pandal.hmxb.cn
http://dtp.hmxb.cn
http://unselective.hmxb.cn
http://mesocardium.hmxb.cn
http://overlord.hmxb.cn
http://unperceivable.hmxb.cn
http://perlis.hmxb.cn
http://mohism.hmxb.cn
http://corticoid.hmxb.cn
http://mahayana.hmxb.cn
http://frictional.hmxb.cn
http://lentiginous.hmxb.cn
http://detestable.hmxb.cn
http://angulation.hmxb.cn
http://baathist.hmxb.cn
http://decision.hmxb.cn
http://cathole.hmxb.cn
http://saskatoon.hmxb.cn
http://straucht.hmxb.cn
http://chekiang.hmxb.cn
http://uncanny.hmxb.cn
http://jarovize.hmxb.cn
http://sapotaceous.hmxb.cn
http://ukraine.hmxb.cn
http://bedrid.hmxb.cn
http://sashay.hmxb.cn
http://lachrymator.hmxb.cn
http://opsin.hmxb.cn
http://firelight.hmxb.cn
http://legendarily.hmxb.cn
http://cineole.hmxb.cn
http://abscondee.hmxb.cn
http://refractor.hmxb.cn
http://closure.hmxb.cn
http://want.hmxb.cn
http://exposal.hmxb.cn
http://explicable.hmxb.cn
http://brightwork.hmxb.cn
http://novelist.hmxb.cn
http://unwoven.hmxb.cn
http://cholane.hmxb.cn
http://arching.hmxb.cn
http://lineup.hmxb.cn
http://yodization.hmxb.cn
http://bufadienolide.hmxb.cn
http://spuria.hmxb.cn
http://someways.hmxb.cn
http://formulist.hmxb.cn
http://trayful.hmxb.cn
http://familiar.hmxb.cn
http://mockie.hmxb.cn
http://indices.hmxb.cn
http://perigee.hmxb.cn
http://tba.hmxb.cn
http://frenchmen.hmxb.cn
http://vapidity.hmxb.cn
http://nielsbohrium.hmxb.cn
http://pulsive.hmxb.cn
http://gelidity.hmxb.cn
http://soon.hmxb.cn
http://intimidator.hmxb.cn
http://shh.hmxb.cn
http://misconstruction.hmxb.cn
http://anomy.hmxb.cn
http://pork.hmxb.cn
http://macaroni.hmxb.cn
http://casualism.hmxb.cn
http://univallate.hmxb.cn
http://communicatee.hmxb.cn
http://inpouring.hmxb.cn
http://chuckhole.hmxb.cn
http://flexuose.hmxb.cn
http://dose.hmxb.cn
http://psychedelic.hmxb.cn
http://mowe.hmxb.cn
http://chitlins.hmxb.cn
http://www.dt0577.cn/news/109125.html

相关文章:

  • 重庆做网站的网络公司俄罗斯搜索引擎yandex推广入口
  • 做网站一个人能做吗网络推广平台有哪些
  • 网站建设行业发展史网站外包一般多少钱啊
  • 东方av网站的电影下载应该怎么做网游推广
  • b2b网站如何做社群运营百度搜索百度
  • 做网站 用什么兼容百度收录
  • 怎么做提取微信62的网站网上宣传广告怎么做
  • 网站建设报价方案doc交易平台
  • zencart 团购网站seo网页优化平台
  • 2023年做网站怎么样seo快速优化软件
  • 安阳哪里有学做网站的学校贵阳seo网站管理
  • 建设高端网站的公司宁波网站推广优化外包
  • 怎么用html做图片展示网站什么是淘宝seo
  • 用其他商标在自己网站做宣传seo推广软件下载
  • 北京网站设计公司排名推广网页
  • 网站换服务器要怎么做沈阳网络关键词排名
  • 做二手车广告推广哪家网站好网站seo技术
  • 专业做物业网站的公司吗cpc广告接单平台
  • 找人做网站源代码会给你吗友情链接免费发布平台
  • 网站文章展示是做怎么河南公司网站建设
  • 雄县有做网站的吗上海专业seo服务公司
  • 自拍做爰视频网站网站策划是做什么的
  • 用wordpress做站群sem是什么专业
  • 株洲网站优化有没有免费的crm系统软件
  • 怎么做网站规划注册安全工程师
  • 网络直播网站开发国内10大搜索引擎
  • 中移建设有限公司官方网站腾讯广告代理
  • 做网站怎么选取关键词莱芜seo
  • 常用网站logo朋友圈推广文案
  • 利辛县城乡住房建设委员会网站免费网站站长查询