0

In the place where I live the internet connection basically works as follows:

You have to configure your network interface to use a unique private ip and the organizations servers as gateway, which is allright. Then have to open and hold an ssh session on a specific server. Only while this connection is open you are able to access the internet.

Now while there is a programm provided to do this for Windows, there is no such option for OS X, Linux or any other OS. I'm trying to write an simple script that has the users password hardcoded and does this job.

I did some research and found this question. I then wrote the following script:

pwd.sh

#!/usr/bin/env bash

echo "123456789"

I created an Automator Application which would execute this script on a bash bash:

export SSH_ASKPASS=/path/to/pwd.sh
ssh 123456789@123.123.123.123

I then made the pwd.sh script executable and added the automator application to the login items. Now on login there's only a message saying that the application could not be executed.

Unfortunatly as of now using sshpass is not possible as it would require XCode to compile, which is not an option.

davidf
  • 1

1 Answers1

0

I would use public/private keys if possible (leave pass phrase empty). That way you don't have to use a password at all.

Instructions for OSX - https://www.drupal.org/node/1070130

Instructions for linux - https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys--2

Now when you login using ssh the key will be passed, the server will recognize it and authorize you to connect without passing password.

CamHart
  • 196