# Proxyman Access Control（访问控制）

> 使用 Proxyman Access Control 允许全部、阻止全部，或仅允许指定 IP 地址连接到代理，并可通过命令行设置模式。

## 1. 这是什么？ {#1-whats-it}

Access Control 是一项高级功能，可用于定义远程设备（iPhone、Android 或其他电脑）如何连接到 Proxyman 应用。它专为需要更高安全性的企业用户设计。

可在 **Tools** 菜单 -> **Proxy Settings** -> **Access Control…** 中打开。

<table><thead><tr><th width="169">模式</th><th>说明</th></tr></thead><tbody><tr><td>Allow All</td><td>所有远程连接都可以连接到 Proxyman（默认）。</td></tr><tr><td>Disallow All</td><td>不允许任何远程连接到 Proxyman。</td></tr><tr><td>Specify Remote Devices by IP</td><td>按 IP 地址定义可以连接到 Proxyman 应用的设备。</td></tr></tbody></table>

![Proxyman Access Control 窗口，已选择 Specify Remote Devices by IP，并包含两个允许的 IP 地址](https://proxyman.com/docs/assets/proxyman-access-control-window.jpg)

_Access Control 窗口_

勾选 **Prompt to allow unauthorized connections** 后，对于不在列表中的设备，Proxyman 会询问是允许还是拒绝其连接。

![Proxyman 提示用户允许或拒绝来自远程设备 IP 地址的连接](https://proxyman.com/docs/assets/Screenshot%202023-01-19%20at%2014.31.47.png)

_允许未授权连接的提示_

## 2. 通过命令行覆盖 Access Control 模式 {#2-override-the-access-control-mode-by-command-lines}

从 Proxyman 4.4.0 开始，可使用以下命令覆盖 Access Control 模式。

如果公司希望在不使用应用界面的情况下强制执行某种模式，这个功能会很有用。

```
$ defaults write ~/Library/Preferences/com.proxyman.NSProxy.plist accessControlModeString "allowAll"
$ defaults write ~/Library/Preferences/com.proxyman.NSProxy.plist accessControlModeString "disallowAll"
$ defaults write ~/Library/Preferences/com.proxyman.NSProxy.plist accessControlModeString "specificIP"
```
