{"action":"opened","issue":{"url":"https://api.github.com/repos/Juniper/py-junos-eznc/issues/573","repository_url":"https://api.github.com/repos/Juniper/py-junos-eznc","labels_url":"https://api.github.com/repos/Juniper/py-junos-eznc/issues/573/labels{/name}","comments_url":"https://api.github.com/repos/Juniper/py-junos-eznc/issues/573/comments","events_url":"https://api.github.com/repos/Juniper/py-junos-eznc/issues/573/events","html_url":"https://github.com/Juniper/py-junos-eznc/issues/573","id":170182036,"number":573,"title":"StartShell default tcp port hardcoded","user":{"login":"miguelgr83","id":17834721,"avatar_url":"https://avatars.githubusercontent.com/u/17834721?v=3","gravatar_id":"","url":"https://api.github.com/users/miguelgr83","html_url":"https://github.com/miguelgr83","followers_url":"https://api.github.com/users/miguelgr83/followers","following_url":"https://api.github.com/users/miguelgr83/following{/other_user}","gists_url":"https://api.github.com/users/miguelgr83/gists{/gist_id}","starred_url":"https://api.github.com/users/miguelgr83/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miguelgr83/subscriptions","organizations_url":"https://api.github.com/users/miguelgr83/orgs","repos_url":"https://api.github.com/users/miguelgr83/repos","events_url":"https://api.github.com/users/miguelgr83/events{/privacy}","received_events_url":"https://api.github.com/users/miguelgr83/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-09T14:34:14Z","updated_at":"2016-08-09T14:34:14Z","closed_at":null,"body":"Hi guys,\r\n\r\nIt seems the port is pre-stablished in the code when you try to perform a \"start-shell\" command\r\nhttps://github.com/Juniper/py-junos-eznc/blob/master/lib/jnpr/junos/utils/start_shell.py#L78\r\n\r\nI did some testing and I can confirm that it wont take \"port\" as a variable and it will always try to connect to tcp/22.\r\n\r\nDo you think you can fix this in the future?\r\n\r\nThese are some tests I've done to confirm that.\r\n\r\nThis is regular PyEz and works\r\nfrom jnpr.junos import Device\r\nhost_ip = \"127.0.0.1\"\r\nport = \"8011\"\r\nusername = \"miguel\"\r\npassword = “Juniper\"\r\ndev = Device(host=host_ip, port=port, user=username, password=password)\r\ndev.open()\r\n\r\nThis is my attempt to run Start Shell commands and does not work (it goes to the port 22 instead of the port 8011)\r\n\r\nfrom jnpr.junos import Device\r\nfrom jnpr.junos.utils.start_shell import StartShell\r\nhost_ip = \"127.0.0.1\"\r\nport = \"8011\"\r\nusername = “miguel\"\r\npassword = “Juniper\"\r\ndev = Device(host=host_ip, port=port, user=username, password=password)\r\ndev.open()\r\nss = StartShell(dev)\r\nss.open()\r\nss.run('cli -c \"ping 10.7.240.114 count 5 rapid”')\r\n\r\n>>> dev = Device(host=host_ip, port=port, user=username, password=password)\r\n>>> dev.open()\r\nDevice(127.0.0.1)\r\n>>> ss = StartShell(dev)\r\n>>> ss.open()\r\nTraceback (most recent call last):\r\n  File \"<stdin>\", line 1, in <module>\r\n  File \"/tmp/pip-build-wO4SAk/junos-eznc/jnpr/junos/utils/start_shell.py\", line 79, in open\r\n  File \"/tmp/pip-build-ajZ6CA/paramiko/paramiko/client.py\", line 380, in connect\r\n  File \"/tmp/pip-build-ajZ6CA/paramiko/paramiko/client.py\", line 603, in _auth\r\nparamiko.ssh_exception.AuthenticationException: Authentication failed.\r\n\r\nThe reason it fails is because it goes against port 22 (linux ssh) and not port 8011 (mx port redirect). \r\n\r\nRegards.\r\n\r\n"}}
{"actor":{"display_login":"miguelgr83"}}