doubishi8303 2009-11-23 20:29
浏览 24
已采纳

PHP中的安全性

I've written some PHP scripts to do some server-side work on a headless linux server machine on a LAN. For example, I have http://ipadress/php/operations.php?operation=registerUser&uName=X&uAlias=Y. Now, I want to secure my operations script so that; not everyone on LAN can call it and/or run it but; only the ones that ... have a pre-shared key...? This is the point I'm stuck at, requiring a pre-shared key through a GET/POST parameter would be easisest and probably the worst solution. What is/are a more secure way(s) of achieving client-limitation on php scripts?

(I'm thinking of maybe requiring a crypted key file from client when starting the session, and denying access to everybody who havent started a scure session...? That's just me theoratically thinking, have no idea where to start to do it in php.)

edit: I clealrly remember writing "requiring a pre-shared key through a GET/POST parameter would be easisest and probably the worst solution." at my original post, so please kindly stop answering with this same thing over and over again.

edit2: to clear things up: the operations.php is called by a program on client machines on same LAN. I dont want any non-client or stranger machine to use operations.php and dont want anyone to be able to access it through browser. I require some kind of security/authentication method to prevent that. I'm not looking for login forms or simple HttpAuths... Also, I cant just simply put limitations over IP adresses because; it's just not practical and kinda worse than hard coded non crypted passwords...

  • 写回答

5条回答 默认 最新

  • dsf6281 2009-11-23 22:16
    关注

    If you're using Apache with mod_ssl, it can force clients to authenticate using certificates that are signed by a specific certificate authority.

    In theory, you could create just three certificates: Your signing certificate, your server's certificate, and one certificate to distribute to the clients.

    This is generally considered a bad idea, though. It's usually better to distribute a separate certificate to each client.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?

悬赏问题

  • ¥15 BP神经网络控制倒立摆
  • ¥20 要这个数学建模编程的代码 并且能完整允许出来结果 完整的过程和数据的结果
  • ¥15 html5+css和javascript有人可以帮吗?图片要怎么插入代码里面啊
  • ¥30 Unity接入微信SDK 无法开启摄像头
  • ¥20 有偿 写代码 要用特定的软件anaconda 里的jvpyter 用python3写
  • ¥20 cad图纸,chx-3六轴码垛机器人
  • ¥15 移动摄像头专网需要解vlan
  • ¥20 access多表提取相同字段数据并合并
  • ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角
  • ¥20 Java-Oj-桌布的计算