{"action":"created","issue":{"url":"https://api.github.com/repos/phpseclib/phpseclib/issues/1216","repository_url":"https://api.github.com/repos/phpseclib/phpseclib","labels_url":"https://api.github.com/repos/phpseclib/phpseclib/issues/1216/labels{/name}","comments_url":"https://api.github.com/repos/phpseclib/phpseclib/issues/1216/comments","events_url":"https://api.github.com/repos/phpseclib/phpseclib/issues/1216/events","html_url":"https://github.com/phpseclib/phpseclib/issues/1216","id":277040569,"number":1216,"title":"SSH2 - auth + keyboard-interactive auth","user":{"login":"theunreal","id":6171883,"avatar_url":"https://avatars3.githubusercontent.com/u/6171883?v=4","gravatar_id":"","url":"https://api.github.com/users/theunreal","html_url":"https://github.com/theunreal","followers_url":"https://api.github.com/users/theunreal/followers","following_url":"https://api.github.com/users/theunreal/following{/other_user}","gists_url":"https://api.github.com/users/theunreal/gists{/gist_id}","starred_url":"https://api.github.com/users/theunreal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theunreal/subscriptions","organizations_url":"https://api.github.com/users/theunreal/orgs","repos_url":"https://api.github.com/users/theunreal/repos","events_url":"https://api.github.com/users/theunreal/events{/privacy}","received_events_url":"https://api.github.com/users/theunreal/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2017-11-27T14:39:24Z","updated_at":"2017-11-29T12:22:05Z","closed_at":null,"author_association":"NONE","body":"I'm trying to authenticate to my device which requires user:pass authentication (which works) and keyboard-interactive auth after it.\r\n\r\n1. Connect with user/pass // Works\r\n\r\n```\r\n$ssh = new \\phpseclib\\Net\\SSH2('my-ip');\r\n\r\n$result = $ssh->login('test', 'test123');\r\n```\r\n\r\n2. execute \"en\" (starts keyboard-interactive)\r\n\r\n`echo $ssh->exec('en');`\r\n\r\n3. Output: \"Password:\" --> I need to enter a password here. \r\n\r\nTrying to\r\n\r\n`echo $ssh->exec('my-password'); // doesn't work, auth fails`\r\n\r\nAny idea how I can interactively enter the password in this stage? it seems like exec not working for this one"},"comment":{"url":"https://api.github.com/repos/phpseclib/phpseclib/issues/comments/347844392","html_url":"https://github.com/phpseclib/phpseclib/issues/1216#issuecomment-347844392","issue_url":"https://api.github.com/repos/phpseclib/phpseclib/issues/1216","id":347844392,"user":{"login":"theunreal","id":6171883,"avatar_url":"https://avatars3.githubusercontent.com/u/6171883?v=4","gravatar_id":"","url":"https://api.github.com/users/theunreal","html_url":"https://github.com/theunreal","followers_url":"https://api.github.com/users/theunreal/followers","following_url":"https://api.github.com/users/theunreal/following{/other_user}","gists_url":"https://api.github.com/users/theunreal/gists{/gist_id}","starred_url":"https://api.github.com/users/theunreal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theunreal/subscriptions","organizations_url":"https://api.github.com/users/theunreal/orgs","repos_url":"https://api.github.com/users/theunreal/repos","events_url":"https://api.github.com/users/theunreal/events{/privacy}","received_events_url":"https://api.github.com/users/theunreal/received_events","type":"User","site_admin":false},"created_at":"2017-11-29T12:22:05Z","updated_at":"2017-11-29T12:22:05Z","author_association":"NONE","body":"@terrafrost I had to replace `$ssh->write('lab\\n');` with `$ssh->write(\"lab\\n\");` and it worked!\r\n\r\nFinally, awesome!\r\n\r\nJust one question: sometimes I run commands like copying files that take long (about 20 seconds). Is there any way to \"wait\" start writing to ssh only after the process has completed?\r\n\r\nFor example:\r\n\r\n`$ssh->write(\"copy //some-path// another-path\\n\");\r\n$ssh->write(\"ANOTHER COMMAND \\n\") // Run it only after the command above has completed and the file was copied`"}}
{"actor":{"display_login":"theunreal"}}