Commit Graph

16 Commits

Author SHA1 Message Date
Sergey Ponomarev 28e8daf726 sshtunnel: simplify command composition
Remove append_params and use shell expressions instead e.g. ${port:+-p $port}.

Note that we can't do that with ProxyCommand because it has to be quoted.

The order of options was changed from more important like hostname to just static -nN.

The CompressionLevel option is removed from SSH2.

Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
2023-12-27 17:31:33 +00:00
Sergey Ponomarev d1d1bd60c9 sshtunnel: ProxyCommand option
The ProxyCommand may have spaces so it must be quoted.
So we must use the procd_append_param.
Currently the option is not supported by Dropbear.
But it has -J instead which in OpenSSH means ProxyJump.
So we can't use it to avoid conflict.

Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
2023-12-27 17:31:33 +00:00
Sergey Ponomarev 1a92dbcf32 sshtunnel: allow empty port and user
A user may have some host configured in the .ssh/config with user and port.
But we anyway have to specify them in the sshtunnel.
The change fixes this

Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
2023-10-08 10:29:37 +01:00
Sergey Ponomarev 9ea6f35194 sshtunnel: add enabled option
Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
2023-10-08 10:29:37 +01:00
Sergey Ponomarev 9dd8a62238 sshtunnel: allow empty remoteaddress
Just empty or * may have some semantic difference on a server

Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
2023-10-08 10:29:37 +01:00
Sergey Ponomarev 1d9f10a135 sshtunnel: StrictHostKeyChecking for Dropbear
The dbclient doesn't support the -o StrictHostKeyChecking but it has it's own -y option:
-y    Always accept remote host key if unknown
-y -y Don't perform any remote host key checking (caution)

So we can add these options to make the StrictHostKeyChecking working.
The dbclient will ignore -o StrictHostKeyChecking but use the -y or -yy instead.

The only problem is that the -y flag is also used by the openssh-client:

-y Send log information using the syslog(3) system module.  By default this information is sent to stderr.

This is not critical and once the dbclient start to support the StrictHostKeyChecking we can remove the -y flag.

Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
2023-10-08 10:29:37 +01:00
Sergey Ponomarev f14dae7bc9 sshtunnel: Use -i $IdentityFile instead of -o IdentityFile=$IdentityFile
This makes the sshtunnel compatible with Dropbear.

Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
2023-10-08 10:29:37 +01:00
Sergey Ponomarev 714c97b012 sshtunnel: set StrictHostKeyChecking=accept-new by default
Without the option the ssh will propt a user to accept the host key.
So a user should perform a connection manualy and accept before useing the sshtunnel.
The accept-new is a reasonable trade off.

Also the LogLevel is INFO by default.

Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
2023-10-08 10:29:37 +01:00
Sergey Ponomarev 2a5f9dbcc7 sshtunnel: uci_sshtunnel use example.com
Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
2023-10-08 10:29:37 +01:00
Sergey Ponomarev 41635f946c sshtunnel: uci_sshtunnel simplify
Simplify comment and make it shorter.
Remove triling tab after retrydelay.
Use a full path for IdentityFile because otherwise the uci validation fails with the relative path ~/.ssh

Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
2023-10-08 10:29:37 +01:00
Stefan Weil 32af3694fc sshtunnel: fix type, case and whitespace issues
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2023-04-15 16:49:30 +01:00
Kimmo Vuorinen e7088fe82c sshtunnel: init script improvements
* Fix for OpenSSH pickiness about argument order to be able to use
  tap devices.
* Allow tun/tap devices to be used from index 0 as demonstrated in
  example config.
* Change arithmetic expressions.

Signed-off-by: Kimmo Vuorinen <kimmo.vuorinen@gmail.com>
2020-02-20 09:04:33 +01:00
Jeffery To f5181d615c sshtunnel: Update init script
This replaces the use of uci_validate_section() with
uci_load_validate(), which removes the need to declare local variables
for every config option.

This also fixes some validation, makes variable declarations local,
removes unnecessary curly brackets.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2019-02-04 09:17:14 +01:00
Kiril Zyapkov 9d3877d446 sshtunnel: switch to procd
This changeset removes the shell wrapper the package used previously,
and uses the instance-management abilities of procd to track ssh
processes. Many fixes and improvements were integrated from the
package maintainer's branch at

https://github.com/nunojpg/packages/tree/sshtunnel

Signed-off-by: Kiril Zyapkov <kiril.zyapkov@gmail.com>
2015-12-14 09:35:03 +02:00
Nuno Goncalves 76f57ca7eb sshtunnel: fixes validation bug with dynamic port forwarding.
Thanks to Avi Alkalay <avi@unix.sh>

Signed-off-by: Nuno Goncalves <nunojpg@gmail.com>
2015-05-25 22:07:04 +01:00
Nuno Goncalves 73392f3ff3 sshtunnel: move to github
Signed-off-by: Nuno Goncalves <nunojpg@gmail.com>
2014-09-16 01:37:29 +01:00