Mac osx 删除云梯VPN 配置文件(remove profiles)

来源:互联网 发布:mysql语句书写顺序 编辑:程序博客网 时间:2024/04/30 11:08

转自:Mac osx 删除云梯VPN 配置文件(remove profiles)

装了云梯VPN,在Mac上部署了云梯VPN提供的配置文件,后来由于某原因弃用这个VPN,却发现不知道怎么删除这profile,在网络列表里留下一堆的VPN配置,看上去很是烦心。 

经过一番搜索,终于在Apple的某文档《wp_osx_configuration_profiles_ml.pdf》上找到了方法: 

利用profiles命令,可以通过profiles -h 查看帮助 

LeondeMacBook-Pro:~ leon$ profiles -h 
profiles allows you to add or remove configuration or application provisioning profiles.   It requires one or more parameters to run: 
Use -h for this help section or use the man page. 

1) These options are single command and should work on most profiles. 
COMMANDS: 
-P,  prints all configuration profiles to console 
Note that profiles must have unique toplevel PayloadUUIDs in order for them to be distinguished as different profiles, so 
different users with the same toplevel PayloadUUIDs will be treated as the same payload for display purposes 
-H,  returns if configuration profiles are installed 
-C,  displays all device profiles 
-D,  deletes existing configuration profiles (requires root privileges) 
-d,  deletes existing provisioning profiles (requires root privileges) 
-h,  displays this help section 
-f,  auto confirm any questions 
-v,  enable verbose mode 
-x,  display version number 
-o path, path to output XML plist file (for -P, -L, -C).  Use 'stdout' to send information to the console. 
-s,  sets the filenamepath profile as a startup profile 
2) These options allow you to operate on configuration profiles:. 
eg,  'profiles -I -F /myprofiles/foo.mobileconfig' 
eg,  'profiles -R -F /myprofiles/foo.mobileconfig' 
eg,  'profiles -L -U gene' 
COMMANDS: 
-I,  sets up command to Install a profile 
-R,  sets up command to Remove a profile 
-L,  lists a user's profiles 
-F filenamepath,  sets up command to read in the existing profile file from the path (not used for -L) or... 
-F -,  sets up command to read in the existing profile file from stdin 
-p profile identifier (only used for removal) 
-Y   specifies the shortname of a local user that will be enrolled with MDM if the profile being installed contains a MDM payload. Will only be used if the profile is being installed as root. 
3) These options allow you to operate on application provisioning profiles:. 
eg,  'profiles -i -F /myprofiles/foo.mobileconfig' 
eg,  'profiles -r -p com.example.123 -u 00000000-0000-0000-0000-000000000000' 
COMMANDS: 
-i,  sets up command to Install a provisioning profile from a file 
-r,  sets up command to Remove a provisioning profile based on the identifier and uuid 
-c,  lists all provisioning profiles 
-d,  sets up command to Delete all provisioning profiles 
-V,  sets up command to Verify a provisioning profile from a file 
-F filenamepath,  sets up command to read in the existing profile file from the path 
-u uuid, in the canonical 36 character form 
-p profile identifier 


1)我们可以看到,通过 profiles -L 命令,可以查看当前用户是否有profile: 

LeondeMacBook-Pro:~ leon$ profiles -L 
leon[1] attribute: profileIdentifier: com.vpncloud.profile 
There are 1 user configuration profiles installed for 'leon' 
上面的结果可以看到我的用户下有一个profile,这个正是云梯VPN的配置文件,Identifier是 com.vpncloud.profile 

2)然后我们用profiles -R 命令可以remove这个profile 

profiles -R 后面可以加两种参数:-F 文件路径 ,-p profile identifier 
-F filenamepath,  sets up command to read in the existing profile file from the path (not used for -L) or... 
-p profile identifier (only used for removal) 


而我不知道这个配置文件的具体路径,所以可以通过-p 这个参数,后面带profile identifier  来删除。 

之前我们通过profiles -L 查看到 profileIndentifier 是 com.vpncloud.profile 
所以我们通过命令:profiles -R -p "com.vpncloud.profile" 就可以删掉这个profile 

3)最后再次 profiles -L 命令检查是否删除成功: 

LeondeMacBook-Pro:~ leon$ profiles -L 
There are no configuration profiles installed for user 'leon' 

世界清静了:)
0 0
原创粉丝点击