Datasets:
Download fix-erlang-ssh-cve/verifier/start_ssh.escript from benchflow/skillsbench: direct link, hf CLI and curl.
- Browser
- Download file 1.39 kB
-
https://huggingface.co/datasets/benchflow/skillsbench/resolve/main/fix-erlang-ssh-cve/verifier/start_ssh.escript
- Command line
-
hf download hf://datasets/benchflow/skillsbench/fix-erlang-ssh-cve/verifier/start_ssh.escript
-
curl -L -o start_ssh.escript https://huggingface.co/datasets/benchflow/skillsbench/resolve/main/fix-erlang-ssh-cve/verifier/start_ssh.escript
1.39 kB
| #!/usr/bin/env escript | |
| %%! -sname ssh_runner | |
| main(_) -> | |
| application:start(asn1), | |
| application:start(crypto), | |
| application:start(public_key), | |
| application:start(ssh), | |
| io:format("Starting SSH daemon with logging...~n"), | |
| case ssh:daemon(2222, [ | |
| {system_dir, "/etc/ssh"}, | |
| {user_dir_fun, fun(User) -> | |
| Dir = filename:join("/home", User), | |
| io:format("Resolving user_dir for ~p: ~s/.ssh~n", [User, Dir]), | |
| filename:join(Dir, ".ssh") | |
| end}, | |
| {connectfun, fun(User, PeerAddr, Method) -> | |
| io:format("Auth success for user: ~p from ~p via ~p~n", | |
| [User, PeerAddr, Method]), | |
| true | |
| end}, | |
| {failfun, fun(User, PeerAddr, Reason) -> | |
| io:format("Auth failed for user: ~p from ~p, reason: ~p~n", | |
| [User, PeerAddr, Reason]), | |
| true | |
| end}, | |
| {auth_methods, "publickey,password"}, | |
| {user_passwords, [{"root", "vulhub"}]}, | |
| {idle_time, infinity}, | |
| {max_channels, 10}, | |
| {max_sessions, 10}, | |
| {parallel_login, true} | |
| ]) of | |
| {ok, _Pid} -> | |
| io:format("SSH daemon running on port 2222. Press Ctrl+C to exit.~n"); | |
| {error, Reason} -> | |
| io:format("Failed to start SSH daemon: ~p~n", [Reason]) | |
| end, | |
| receive | |
| stop -> ok | |
| end. | |