Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Cannot delete VPN Profile

Hi to all, I'm having a problem on my macbook pro munting Lion.


I installed a new VPN profile to connect to a MacMini Server on System Preferences > Network, and I found there an old VPN profile that I don't want to use anymore. I tried to disable the service, but the delete button is greyed out, even if this service is active.


How can I remove this old VPN Profile?


Thanks in advance,


User uploaded file

Posted on Mar 25, 2012 5:20 AM

Reply
Question marked as Best reply

Posted on Nov 12, 2012 4:18 PM

I think I have an easier solution, at least in 10.8.2. I, too, had a VPN configuration that would not go away; the - button was grayed out. Here's what I did, though only step 2 is mandatory.


  1. In Terminal: networksetup -listallnetworkservices
  2. In Terminal: networksetup -removenetworkservice networkservice
  3. In Terminal: networksetup -listallnetworkservices


The first step shows you the names of your networkservices, like "old." The second step removes the network service. Be sure to spell the one you want to remove exactly as it's listed in the results of the first step. The third step confirms it is gone. Only Terminal is required, no XCode. The .plist will automatically update; no need to copy or delete. The remove command bypasses the GUI and removes the service whether or not the - button is grayed out.


Hope this helps. If you run man networkservices you will see many other Terminal commands that maniupulate items in the Network preference pane.

31 replies

Dec 23, 2012 12:32 AM in response to Dhalgren

Hi,

using quotes did the trick and I could delete all obsolete VPN entries.

I admit that I am quite rusty as regards Unix/Terminal commands, an expert user would have known that parameters are parsed between quotes.


You are also right in regard to plist files. I had indeed made a backup copy and I copied that file back. I was very surprised that my locations were gone nonetheless.


Thanks again for your precious help.

Regards,

Twistan

May 8, 2013 8:05 AM in response to Francob

  1. In Terminal: networksetup -listallnetworkservices
  2. In Terminal: networksetup -removenetworkservicenetworkservice
  3. In Terminal: networksetup -listallnetworkservices


User uploaded file


  1. Click the Apple Menu in the upper left corner
  2. Click on System Preferences
  3. In the System Preferences window, click Network
  4. In the Network window, click the Lock and enter your password.
  5. Click + to add a new connection.
  6. In the following prompt, for Interface: select VPN
  7. In the VPN Type:, select L2TP over IPSec
  8. In the Service Name: field, enter Indonesia vpn Connection
  9. Click Create

Jul 4, 2014 10:50 AM in response to Dhalgren

Sorry to bring this up again but I am having the same problem. I tried following your solution of going into terminal but when I do step 2 it returns an error which says:


VpnOneClick- is not a recognized network service.

VpnOneClick- is not a valid network service name.

** Error: The parameters were not valid.


[Process completed]


What I was trying to delete was called:


VpnOneClick- l2tp France Ip


I thought it might be the spaces which was confusing it...Please can you help you seem to know what you're doing!

Thanks

Jul 4, 2014 11:27 AM in response to da dumb person

I suspect you're correct about the spaces, and having the same issue Twistan had on December 23, 2012. This was the gist of my response to him:


Try this:


networksetup -removenetworkservice "VpnOneClick- 12tp France Ip"


Put quotes around the network service name. I think this is necessary because the parentheses cause problems with Terminal interpreting the UNIX command. I created a test network service on my machine, entered the command you did, and got the same error result you did. I then used quotes around the network service name and got the correct result. BTW, depending on your system settings, you may be asked to authenticate the deletion with your administrator password. If so, a dialog box will come up asking for it.


Dhalgren


Let me know if this helps. I haven't tried this solution in 10.9.x but suspect it should work. You're getting the truncated network service name and non-recognition because of the lack of quotes, as discussed above.

Jul 4, 2014 12:14 PM in response to Dhalgren

Thanks for the quick reply. I tried this but it churned out this:


networksetup -listnetworkserviceorder

networksetup -listallnetworkservices

networksetup -listallhardwareports

networksetup -detectnewhardware

networksetup -getmacaddress <hardwareport or device name>

networksetup -getcomputername

networksetup -setcomputername <name>

networksetup -getinfo <networkservice>

networksetup -setmanual <networkservice> <ip> <subnet> <router>

networksetup -setdhcp <networkservice> [clientid]

networksetup -setbootp <networkservice>

networksetup -setmanualwithdhcprouter <networkservice> <ip>

networksetup -setv4off <networkservice>

networksetup -setv6off <networkservice>

networksetup -setv6automatic <networkservice>

networksetup -setv6LinkLocal <networkservice>

networksetup -setv6manual <networkservice> <networkservice> <address> <prefixlength> <router>

networksetup -getdnsservers <networkservice>

networksetup -setdnsservers <networkservice> <dns1> [dns2] [...]

networksetup -getsearchdomains <networkservice>

networksetup -setsearchdomains <networkservice> <domain1> [domain2] [...]

networksetup -create6to4service <newnetworkservicename>

networksetup -set6to4automatic <networkservice>

networksetup -set6to4manual <networkservice> <relayaddress>

networksetup -getftpproxy <networkservice>

networksetup -setftpproxy <networkservice> <domain> <port number> <authenticated> <username> <password>

networksetup -setftpproxystate <networkservice> <on off>

networksetup -getwebproxy <networkservice>

networksetup -setwebproxy <networkservice> <domain> <port number> <authenticated> <username> <password>

networksetup -setwebproxystate <networkservice> <on off>

networksetup -getsecurewebproxy <networkservice>

networksetup -setsecurewebproxy <networkservice> <domain> <port number> <authenticated> <username> <password>

networksetup -setsecurewebproxystate <networkservice> <on off>

networksetup -getstreamingproxy <networkservice>

networksetup -setstreamingproxy <networkservice> <domain> <port number> <authenticated> <username> <password>

networksetup -setstreamingproxystate <networkservice> <on off>

networksetup -getgopherproxy <networkservice>

networksetup -setgopherproxy <networkservice> <domain> <port number> <authenticated> <username> <password>

networksetup -setgopherproxystate <networkservice> <on off>

networksetup -getsocksfirewallproxy <networkservice>

networksetup -setsocksfirewallproxy <networkservice> <domain> <port number> <authenticated> <username> <password>

networksetup -setsocksfirewallproxystate <networkservice> <on off>

networksetup -getproxybypassdomains <networkservice>

networksetup -setproxybypassdomains <networkservice> <domain1> [domain2] [...]

networksetup -getproxyautodiscovery <networkservice>

networksetup -setproxyautodiscovery <networkservice> <on off>

networksetup -getpassiveftp <networkservice>

networksetup -setpassiveftp <networkservice> <on off>

networksetup -getairportnetwork <device name>

networksetup -setairportnetwork <device name> <network> [password]

networksetup -getairportpower <device name>

networksetup -setairportpower <device name> <on off>

networksetup -listpreferredwirelessnetworks <device name>

networksetup -addpreferredwirelessnetworkatindex <device name> <network> <index> <security type> [password]

networksetup -removepreferredwirelessnetwork <device name> <network>

networksetup -removeallpreferredwirelessnetworks <device name>

networksetup -getnetworkserviceenabled <networkservice>

networksetup -setnetworkserviceenabled <networkservice> <on off>

networksetup -createnetworkservice <newnetworkservicename> <hardwareport>

networksetup -renamenetworkservice <networkservice> <newnetworkservicename>

networksetup -duplicatenetworkservice <networkservice> <newnetworkservicename>

networksetup -removenetworkservice <networkservice>

networksetup -ordernetworkservices <service1> <service2> <service3> <...>

networksetup -getMTU <hardwareport or device name>

networksetup -setMTU <hardwareport or device name> <value>

networksetup -listvalidMTUrange <hardwareport or device name>

networksetup -getmedia <hardwareport or device name>

networksetup -setmedia <hardwareport or device name> <subtype> [option1] [option2] [...]

networksetup -listvalidmedia <hardwareport or device name>

networksetup -createVLAN <VLAN name> <parent device name> <tag>

networksetup -deleteVLAN <VLAN name> <parent device name> <tag>

networksetup -listVLANs

networksetup -listdevicesthatsupportVLAN

networksetup -isBondSupported <hardwareport>

networksetup -createBond <bondname> <hardwareport1> <hardwareport2> <...>

networksetup -deleteBond <bonddevicename>

networksetup -addDeviceToBond <hardwareport> <bonddevicename>

networksetup -removeDeviceFromBond <hardwareport> <bonddevicename>

networksetup -listBonds

networksetup -showBondStatus <bonddevicename>

networksetup -listpppoeservices

networksetup -showpppoestatus <service name ie., MyPPPoEService>

networksetup -createpppoeservice <device name ie., en0> <service name> <account name> <password> [pppoe service name]

networksetup -deletepppoeservice <service name>

networksetup -setpppoeaccountname <service name> <account name>

networksetup -setpppoepassword <service name> <password>

networksetup -connectpppoeservice <service name>

networksetup -disconnectpppoeservice <service name>

networksetup -getcurrentlocation

networksetup -listlocations

networksetup -createlocation <location name> [populate]

networksetup -deletelocation <location name>

networksetup -switchtolocation <location name>

networksetup -listalluserprofiles

networksetup -listloginprofiles <service name>

networksetup -enablesystemprofile <service name> <on off>

networksetup -enableloginprofile <service name> <profile name> <on off>

networksetup -enableuserprofile <profile name> <on off>

networksetup -import8021xProfiles <service name> <file path>

networksetup -export8021xProfiles <service name> <file path> <yes no>

networksetup -export8021xUserProfiles <file path> <yes no>

networksetup -export8021xLoginProfiles <service name> <file path> <yes no>

networksetup -export8021xSystemProfile <service name> <file path> <yes no>

networksetup -settlsidentityonsystemprofile <service name> <file path> <passphrase>

>networksetup -settlsidentityonuserprofile <profile name> <file path> <passphrase>networksetup -deletesystemprofile <service name>

networksetup -deleteloginprofile <service name> <profile name>

networksetup -deleteuserprofile <profile name>

networksetup -version

networksetup -help

networksetup -printcommands

** Error: The command is not recognized.


[Process completed]

Jul 4, 2014 1:28 PM in response to da dumb person

I definitely think you just typed something wrong. Before acting as a SuperUser (see below), carefully enter the command again. If both of our spellings of the network service name is correct, you can just cut and past the command I typed below. Leave out the sudo though, unless it returns "Permission denied." Be sure to check the spelling of the network service name.


Wow!! Looks like a dump of every possible command in the networksetup collection. I suspect you either typed something in incorrectly (most likely since it says it can't find the command) or 10.9.3 wants you to act as the root user (SuperUser) for this command. I don't remember if that was true under 10.7 but I don't think it was. Also, if that's the only network service available for a hardware port, you won't be able to remove it this way. If that happens to be the case, see the description at the bottom, which describes the -removenetworkservice command. If that's not the case, and there are other network services on this port, keep going right here.


To act as the root user (SuperUser) and enter the command to delete the network service, enter (I'm assuming my spelling is correct; check it):

sudo networksetup -removenetworkservice "VpnOneClick- l2tp France Ip"

You will get a prompt for Password:

Type in your administrator password. You have to be an administrative user to do this, which, if it's your computer, you should be.

Nothing will happen as you type the password. The cursor won't even move. Then, hit return.

If this works, check by entering: networksetup -listallnetworkservices. If all went well, VpnOneClick- 12tp France Ip should be gone. Quit Terminal. You don't want to be logged in as root for any longer than necessary because all safeguards are gone and you can do a lot of damage by mistake.

sudo stands for SuperUser DO.

This is from the command: man networksetup:

-removenetworkservice networkservice

Use this command to delete a network service <networkservice>. You cannot use this command to delete the last remaining

service for a hardware port. To do so, you use the -setnetworkserviceenabled command.

Nov 12, 2014 8:09 PM in response to butrusgali

[EDIT: FINALLY FIGURED IT OUT! --> It's from hotspotshield. Go to your system preferences, and there should be an icon called "profiles". Click it and click the minus sign next to the hotspotshield certificate, type in your admin password, and the servers will erase from your networks".]

I've never seen these three servers in my networks in the many many years I've been on a macbook. Do you know why they appeared on your computer in the first place, or what they are?


The US Server on mine was called "ancientarmenia.us"


The GB Server on mine was called "jacketmagazine.us"


This last one the JP Server I can't delete because of IPv4... is called "brain photos.us"


Any idea what these are or why they are on our computers?

Dec 9, 2015 8:20 PM in response to sinafromcanterbury

sinafroncanterbury i had the same problem and i was then was able to fix that problem because it turned out that when i was trying to remove it i removed all the credentials and everything to try and un gray the button. So how i fixed it was i went though the setup process again to put everything back to how it was then once i did that i put in networksetup -removenetworkservice 'Servicename' make sure to put in this exact command just copy and paste it from here the command is everything that is bolded. The only thing you need to change is what is in the single quotes replace what is in side the quotes with the name of the service you are trying to delete. As SAABBOY93 says then it will prompt you to put in admin credentials.


That should fix your problem.


I hope that helps and please let us know if you get that work.

Cannot delete VPN Profile

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.