- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Connect to vpn - FortiCLient using Linux command line, passing password
Hi there,
On a Debian/Ubuntu box, I have installed: forticlient_vpn_7.0.7.0246_amd64.deb, which using the command line "not Desktop" just bash.
I am able to connect to the company VPN using a syntax like:
/opt/forticlient/vpn -s office.***.com:_PORT_GOES_HERE_ -u MY_USERNAME -p
password:
State: Connecting
...
I was wondering how I can pass the password when the VPN app asks for, or if there is other parameter?
Thanks in advance.
- Labels:
-
FortiClient
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Are you wanting to pass the password in the command line arguments to avoid having it be interactive?
Graham
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yes, I'd like that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
DO any of these CLI options help you? Looks like you can create a profile that you reference in the CLI arguments...
Graham
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am not sure about what you are mentioning, I am not familiar with that one.
I'd like to be able to pass to the "FortiClient" VPN binary, like other VPN software I have worked with "using CLI" where I can pass the password, the same way I pass username and other parameters.
I am able to use 'expect' this way, but it's hacky
expect expect_response.exp 'passwordGoesHere'
Running on Ubuntu 20.04 LTS, but I assume for Debian 10/11 should work as well.
content of file: expect_response.exp it expects one parameter:
#!/usr/bin/expect
set PASS [lindex $argv 0]
set timeout -1
spawn /opt/forticlient/vpn -s officeAddressAndPortGoesHere -u myUserNameGoesHere -p
expect -exact "password:"
send -- "$PASS\r"
set timeout -1
expect eof
