Home  >  Q&A  >  body text

网络安全 - Linux系统如何通过token鉴权方式限制外部ip对某个端口的访问?

公司搭建了服务器,希望只有内网以及员工自己的机器能够访问一个端口。目前的做法是使用iptables封死了所有从外部对这个端口的访问,然后添加例外使员工能够从外部访问。这样的效率极低。有没有什么方便的工具能够使用类似token鉴权一类的方式进行限制?

高洛峰高洛峰2765 days ago254

reply all(3)I'll reply

  • 大家讲道理

    大家讲道理2017-04-17 13:36:13

    It just so happens that our company has had similar needs. We use nginx to forward this port, and then use nginx’s basic authentication function and htpasswd to generate a password, so that it can be accessed through USERNAME:USERPASSWD@IP:PORT.

    Reference: https://www.digitalocean.com/community/tutorials/how-to-set-up-a-private-docker-registry-on-ubuntu-14-04 step4

    reply
    0
  • 怪我咯

    怪我咯2017-04-17 13:36:13

    Use pam authentication, one account per person

    reply
    0
  • 怪我咯

    怪我咯2017-04-17 13:36:13

    I have heard of LDAP. Someone recommended it to me, but I have never used it. You can check it out.

    reply
    0
  • Cancelreply