Skip to content

Commit 3c97c4a

Browse files
ynezzAnsuel
authored andcommitted
dropbear: enable configurable port forwarding options
Currently its only possible to disable port forwarding only for specific keys, via the OpenSSH-style restriction in `authorized_keys` file. In some use cases it might be feasible to disable such features globally on service level, so lets add new LocalPortForward and RemotePortForward config knobs. Signed-off-by: Petr Štetiar <[email protected]> Link: openwrt/openwrt#21071 (cherry picked from commit 83f6177) [ fix conflict error ] Signed-off-by: Christian Marangi <[email protected]>
1 parent 30b7a5f commit 3c97c4a

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

package/network/services/dropbear/files/dropbear.config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ config dropbear main
55
option RootPasswordAuth 'on'
66
option Port '22'
77
# option BannerFile '/etc/banner'
8+
# option LocalPortForward 'off'
9+
# option RemotePortForward 'off'

package/network/services/dropbear/files/dropbear.init

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,8 @@ validate_section_dropbear()
179179
'IdleTimeout:uinteger:0' \
180180
'MaxAuthTries:uinteger:3' \
181181
'RecvWindowSize:uinteger:262144' \
182+
'LocalPortForward:bool:1' \
183+
'RemotePortForward:bool:1' \
182184
'mdns:bool:1'
183185
}
184186

@@ -319,6 +321,8 @@ dropbear_instance()
319321
fi
320322
[ "${PasswordAuth}" -eq 0 ] && procd_append_param command -s
321323
[ "${GatewayPorts}" -eq 1 ] && procd_append_param command -a
324+
[ "${LocalPortForward}" -eq 0 ] && procd_append_param command -j
325+
[ "${RemotePortForward}" -eq 0 ] && procd_append_param command -k
322326
[ -n "${ForceCommand}" ] && procd_append_param command -c "${ForceCommand}"
323327
[ "${RootPasswordAuth}" -eq 0 ] && procd_append_param command -g
324328
[ "${RootLogin}" -eq 0 ] && procd_append_param command -w

0 commit comments

Comments
 (0)