adagios icon indicating copy to clipboard operation
adagios copied to clipboard

okconfig install ssh agent - different Port

Open reneski opened this issue 9 years ago • 3 comments

i'm trying to use the okconfig ssh install script to setup the linux clients. for the ssh connections i mostly use different ports than the default port 22.

would it be possible to add an option to set a different port?

reneski avatar Apr 07 '15 13:04 reneski

have you tried adding the port to the address? like so 127.0.0.1:2222

hakong avatar Apr 08 '15 12:04 hakong

yes i did. output looks like this:

[root@naemon ~]# okconfig install linux-test --ssh --user root --host=192.168.0.100:22333 --verbose --interactive --debug
Password: 
Install script on linux-test failed with exit_status 128
Output:
Exception occured while running install_okagent
Errors:
Cannot reach remote_host on port 22, aborting...
Script output:
Exception occured while running install_okagent
Install script on 192.168.0.100:22333 failed with exit_status 128
Output:
Exception occured while running install_okagent
Errors:
Cannot reach remote_host on port 22, aborting...
Script output:
Exception occured while running install_okagent

reneski avatar Apr 08 '15 13:04 reneski

nano /usr/lib/python2.6/site-packages/okconfig/init.py

change: ssh.connect(remote_host, username=username, password=password) to: ssh.connect(remote_host, port=22333, username=username, password=password)

I came across this when trying todo the same myself.

okconfig uses paramiko python package - which allows you to specify the actual port on the connect function - however okconfig omits the ability to do this - You could go one step further and add it as an option... so you can pass via the command line

/usr/lib/python2.6/site-packages/paramiko/client.py

def connect(self, hostname, port=port, username=None, password=None, pkey=None, key_filename=None, timeout=None, allow_agent=True, look_for_keys=True):

shaynem avatar Aug 22 '16 03:08 shaynem