Kuba/ssh/services disabled by default hardening guide update/otp 19969/otp 20078/otp 20079#10970
Merged
u3s merged 3 commits intoerlang:masterfrom Apr 13, 2026
Conversation
Contributor
CT Test Results 3 files 92 suites 1h 35m 10s ⏱️ For more details on these failures, see this check. Results for commit f6b844c. ♻️ This comment has been updated with latest results. To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass. See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally. Artifacts
// Erlang/OTP Github Action Bot |
6b978a0 to
36904ab
Compare
36904ab to
4761e66
Compare
4761e66 to
ae811ec
Compare
ae811ec to
012f412
Compare
IngelaAndin
reviewed
Apr 10, 2026
012f412 to
e9de033
Compare
Mikaka27
requested changes
Apr 10, 2026
Mikaka27
approved these changes
Apr 10, 2026
Change the shell and exec daemon options to default to disabled
instead of enabling the Erlang shell and Erlang term evaluation
respectively. This implements the "secure by default" principle,
preventing authenticated users from executing arbitrary Erlang code
unless explicitly configured.
The new erlang_eval exec option enables Erlang term evaluation via
exec requests, replacing the previous implicit behavior.
Applications requiring these services must now explicitly enable them:
%% Enable Erlang shell
ssh:daemon(Port, [{shell, {shell, start, []}} | Options])
%% Enable Erlang term evaluation via exec
ssh:daemon(Port, [{exec, erlang_eval} | Options])
Also fix a client-side crash in ssh:shell/1 where the missing exec
key in options caused channel_cb_init_args/1 to append undefined to
the callback init args. Both erlang_eval and undefined are now
filtered out, as neither is a callback init argument.
The subsystems daemon option now defaults to an empty list instead
of enabling the SFTP subsystem via ssh_sftpd:subsystem_spec([]).
This extends the "secure by default" principle to also cover SFTP,
complementing the shell and exec default changes.
Previously, all authenticated SSH users had access to the entire
file system visible to the Erlang VM process through the default
SFTP subsystem, with no path restrictions.
Changes:
- Change subsystems default from [ssh_sftpd:subsystem_spec([])] to []
- Update subsystem_spec doc string in ssh.hrl
- Remove dead code in ssh_connection:check_subsystem/2
- Update test suites to explicitly enable SFTP where needed
- Update documentation (hardening.md, introduction.md, using_ssh.md,
ssh_app.md, terminology.md)
Applications requiring SFTP must now explicitly enable it:
ssh:daemon(Port, [{subsystems, [ssh_sftpd:subsystem_spec([])]}
| Options])
Add sections on SFTP enablement, network-level security and advanced authentication: - SFTP subsystem enablement with root option and rights model reference - Non-root VM recommendation in introduction - IP binding restrictions (daemon/3 vs daemon/2 default behavior) - MFA limitations and VPN alternative recommendation - Public key validation via key_cb with pk_check_user - Account lockout using pwdfun with cross-connection ETS tracking
6e5f3f1 to
f6b844c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.