Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Save Password in rasdial?

Tags:

windows

vpn

guys.

I want to use the windows RASDIAL in my app to connect to a VPN.

I'm using this cmd command:

rasdial a-1 username pass

I just want to know, how to save password in this command for the next connects?

Thanks.

like image 381
Mostafa Farzán Avatar asked Jan 06 '13 08:01

Mostafa Farzán


2 Answers

Probably the OP already solve the problem (asked 4 years ago), but rasdial can't save the password. But you can use your stored credentials in Windows with rasphone. Remember to uncheck "Prompt for name and password, certificate, etc." in the connection properties to skip the dialog.

You can use rasphone.exe to dial a connection using stored credentials:

rasphone -d "VPN NAME"

Hangup with:

rasphone -h "VPN NAME"

You'll also need to go into the option tab of the properties for your VPN connection and uncheck "Prompt for name and password, certificate, etc."

https://superuser.com/a/894969/27235

like image 97
Dudaskank Avatar answered Sep 28 '22 16:09

Dudaskank


In Windows 10, rasphone will always prompt for credentials (Option to skip this step is gone. Thanks, Microsoft!). But I was able to use my saved password with rasdial by using EAP authentication:

Without EAP, MS-CHAP v2 does not work.

Now I can just execute rasdial VpnName, and it uses my saved password.

like image 28
Eugene Avatar answered Sep 28 '22 16:09

Eugene