by MayeulC · 7y ago · 0 comments
However, I expect plenty of people to be in the same case.
A simpler invocation could run it through (unencrypted) inetd/socket activation.
SELINUX really throws fits of hysteria when running this, however.
$ cat sftp-tls.sh
#!/bin/sh
exec nc --ssl server 52345
$ sftp -S ./sftp-tls.sh bogus
Connected to bogus.
sftp> cd /nobody
sftp> get sftp-tls
Fetching /nobody/sftp-tls to sftp-tls
/nobody/sftp-tls 100% 15 8.9KB/s 00:00
sftp> quit
# cat /etc/stunnel/sftp-ssl.conf
#GLOBAL####
;sslVersion = TLSv1.2
TIMEOUTidle = 6000
renegotiation = no
FIPS = no
options = NO_SSLv2
options = NO_SSLv3
options = SINGLE_DH_USE
options = SINGLE_ECDH_USE
options = CIPHER_SERVER_PREFERENCE
syslog = yes
debug = debug
setuid = nobody
setgid = nobody
# chroot = /var/empty/stunnel
libwrap = no
service = sftp-ssl
; cd /var/empty; mkdir -p stunnel/etc; cd stunnel/etc;
; echo 'sftp-ssl: ALL EXCEPT localhost' >> hosts.deny;
; chcon -t stunnel_etc_t hosts.deny
; https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/
ciphers=ECDH+AESGCM:ECDH+CHACHA20:DH+AESGCM:RSA+AESGCM:!aNULL:!MD5:!DSS
curve = secp521r1
#CREDENTIALS####
# verify = 4
cert = /etc/stunnel/sftp-ssl.pem
#ROLE####
exec = /usr/libexec/openssh/sftp-server
# execargs= sftp-server -d /home/nobody
# execargs= sftp-server -l DEBUG3Rsync's ssh support is generally good, so might be about equivalent, but it's not always handy.
1: https://www.cyberciti.biz/faq/howto-use-tar-command-through-...
Also rsync does not exist on windows, for instance git bash has only scp AFAIK.
https://docs.microsoft.com/en-us/previous-versions/windows/d...
scp wins on brevity of commandline syntax
Would be nice to be able to just type sftp user@domain:/file and have it do the right thing.