Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tsohr/49859b54670ca7e11dcb960dfe50cd83 to your computer and use it in GitHub Desktop.
Save tsohr/49859b54670ca7e11dcb960dfe50cd83 to your computer and use it in GitHub Desktop.
Install forticlient in linux. Replace HOST, PORT, USER and PASS.
sudo apt-get install expect
wget https://hadler.me/files/forticlient-sslvpn_4.4.2333-1_amd64.deb
sudo dpkg -i forticlient-sslvpn_4.4.2333-1_amd64.deb
/opt/forticlient-sslvpn/64bit/helper/setup
cat > sslvpn << EOF
#!/usr/bin/expect -f
set hostandport [lindex \$argv 0];
set user [lindex \$argv 1];
set pass [lindex \$argv 2];
set timeout -1
cd /opt/forticlient-sslvpn/64bit/
spawn ./forticlientsslvpn_cli --server \$hostandport --vpnuser \$user --keepalive
expect "Password for VPN:" {send -- "\$pass\r"}
expect "to this server? (Y/N)\r" {send -- "y\r"}
expect eof
EOF
chmod +x sslvpn
sudo mv sslvpn /usr/local/bin/
# please try with Ubuntu.
[Unit]
Description=SSL VPN connection for the site ABC
Wants=network.target
After=network-online.target
[Service]
Restart=always
ExecStart=/usr/local/bin/sslvpn -d somehost:443 someuser somepw
ExecStop=/bin/kill $MAINPID
Type=simple
RestartSec=10
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=sslvpn-site-ABC
[Install]
WantedBy=multi-user.target default.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment