Como especificar vários destinos na diretiva PermitOpen do servidor OpenSSH?

1

Descobri como restringir túneis TCP por usuário. Agora gostaria de dar a alguns usuários / grupos acesso a vários clientes na rede.

Quando eu sigo as instruções da documentação do servidor OpenSSH, não consigo reiniciar o servidor OpenSSH.

Da documentação:

PermitOpen
Specifies the destinations to which TCP port forwarding is permitted. The forwarding specification must be one of the following forms:

PermitOpen host:port
PermitOpen IPv4_addr:port
PermitOpen [IPv6_addr]:port

Multiple forwards may be specified by separating them with whitespace. An argument of any can be used to remove all restrictions and permit any forwarding requests. An argument of none can be used to prohibit all forwarding requests. The wildcard ‘*’ can be used for host or port to allow all hosts or ports, respectively. By default all port forwarding requests are permitted.

(Source: http://manpages.ubuntu.com/manpages/zesty/en/man5/sshd_config.5.html)

Estou usando estas configurações:

Match Group SSHTunnel_WebUI
    AllowTcpForwarding yes
    PermitOpen="gitlab.company.de:80 wiki.company.de:80"

Quando eu removo o segundo FQDN:port , posso reiniciar o sshd , caso contrário, recebo uma mensagem de erro reclamando sobre o arquivo de configuração. Outras regras similares, mas com apenas uma configuração FQDN:port , funcionam como esperado.

Como formatar a string de configurações?

A mensagem de erro dada por journalctl -xe

Jan 08 00:45:56 wiki sshd[55992]: /etc/ssh/sshd_config line 150: bad port number in PermitOpen
Jan 08 00:45:56 wiki systemd[1]: ssh.service: Control process exited, code=exited status=255
Jan 08 00:45:56 wiki systemd[1]: ssh.service: Failed with result 'exit-code'.
Jan 08 00:45:56 wiki systemd[1]: Failed to start OpenBSD Secure Shell server.
-- Subject: Unit ssh.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit ssh.service has failed.
--
-- The result is RESULT.
Jan 08 00:45:56 wiki systemd[1]: ssh.service: Service hold-off time over, scheduling restart.
Jan 08 00:45:56 wiki systemd[1]: ssh.service: Scheduled restart job, restart counter is at 5.

Perguntas e links relacionados, mas não aplicáveis:

por Paebbels 08.01.2018 / 00:59

1 resposta

3

O formato de PermitOpen é uma lista separada por espaços de pares host: port. No entanto, o exemplo de configuração que você deu possui aspas. Isso não é permitido.

Use aspas no (e o = também é opcional):

PermitOpen gitlab.company.de:80 wiki.company.de:80
    
por 08.01.2018 / 01:16