{"action":"created","issue":{"url":"https://api.github.com/repos/antonyantony/openssh/issues/3","repository_url":"https://api.github.com/repos/antonyantony/openssh","labels_url":"https://api.github.com/repos/antonyantony/openssh/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/antonyantony/openssh/issues/3/comments","events_url":"https://api.github.com/repos/antonyantony/openssh/issues/3/events","html_url":"https://github.com/antonyantony/openssh/issues/3","id":141247858,"number":3,"title":"permitremoteopen with multiple ports","user":{"login":"dmatic","id":5310192,"avatar_url":"https://avatars.githubusercontent.com/u/5310192?v=3","gravatar_id":"","url":"https://api.github.com/users/dmatic","html_url":"https://github.com/dmatic","followers_url":"https://api.github.com/users/dmatic/followers","following_url":"https://api.github.com/users/dmatic/following{/other_user}","gists_url":"https://api.github.com/users/dmatic/gists{/gist_id}","starred_url":"https://api.github.com/users/dmatic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmatic/subscriptions","organizations_url":"https://api.github.com/users/dmatic/orgs","repos_url":"https://api.github.com/users/dmatic/repos","events_url":"https://api.github.com/users/dmatic/events{/privacy}","received_events_url":"https://api.github.com/users/dmatic/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-16T11:41:48Z","updated_at":"2016-03-25T16:21:25Z","closed_at":null,"body":"Hi, is it possible to list multiple ports with permitremoteopen restriction? I've tried `permitremoteopen=\"xxx,yyy\" ssh-rsa...` and `permitremoteopen=\"xxx\",\"yyy\" ssh-rsa...` , but it only recognizes `permitremoteopen=\"xxx\" ssh-rsa` option, with all other combinations I get `Permission denied (publickey).` error. \r\n\r\nAlso, is it possible to terminate a connection when the port doesn't match? I get the `Warning: remote port forwarding failed for listen port ZZZZZ`. but the connection is not terminated afterwards. "},"comment":{"url":"https://api.github.com/repos/antonyantony/openssh/issues/comments/201348906","html_url":"https://github.com/antonyantony/openssh/issues/3#issuecomment-201348906","issue_url":"https://api.github.com/repos/antonyantony/openssh/issues/3","id":201348906,"user":{"login":"antonyantony","id":1748530,"avatar_url":"https://avatars.githubusercontent.com/u/1748530?v=3","gravatar_id":"","url":"https://api.github.com/users/antonyantony","html_url":"https://github.com/antonyantony","followers_url":"https://api.github.com/users/antonyantony/followers","following_url":"https://api.github.com/users/antonyantony/following{/other_user}","gists_url":"https://api.github.com/users/antonyantony/gists{/gist_id}","starred_url":"https://api.github.com/users/antonyantony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antonyantony/subscriptions","organizations_url":"https://api.github.com/users/antonyantony/orgs","repos_url":"https://api.github.com/users/antonyantony/repos","events_url":"https://api.github.com/users/antonyantony/events{/privacy}","received_events_url":"https://api.github.com/users/antonyantony/received_events","type":"User","site_admin":false},"created_at":"2016-03-25T16:21:25Z","updated_at":"2016-03-25T16:21:25Z","body":"multiple ports forwarding are allowed. \r\nsyntax is : permitremoteopen=\"8080\",permitremoteopen=\"8081\" ssh-rsa AAAAB3NzaC\r\n\r\nssh -v -R 8080:127.0.0.1:22 -R 8081:127.0.0.1:22 -p 2022 user@server\r\ndebug1: remote forward success for: listen 8080, connect 127.0.0.1:22\r\ndebug1: remote forward success for: listen 8081, connect 127.0.0.1:22\r\n\r\nterminating when forward fails is not easy. port forward can be initiated after the session is established too. Not all forwards are at the beginning. Some may fail and some succeed it is not possible to terminated a ssh session based on failure to forward. This is the behavior of permitopen, permitremoteopen is based on permitopen."}}