From 3a5abf2d29292f56969e9c90b5698e71d456e2f8 Mon Sep 17 00:00:00 2001 From: Richard Carlsson Date: Tue, 17 Apr 2018 20:12:17 +0200 Subject: Use ssh as the default remote shell --- erts/doc/src/erl.xml | 2 +- lib/common_test/test_server/ts_install.erl | 2 +- lib/erl_interface/src/prog/erl_start.c | 2 +- lib/inets/examples/httpd_load_test/hdlt_slave.erl | 11 +++++------ lib/mnesia/examples/bench/README | 2 +- lib/stdlib/doc/src/slave.xml | 12 +++++++----- lib/stdlib/src/slave.erl | 13 ++++++------- 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/erts/doc/src/erl.xml b/erts/doc/src/erl.xml index 05a9895687..88ddb03e97 100644 --- a/erts/doc/src/erl.xml +++ b/erts/doc/src/erl.xml @@ -464,7 +464,7 @@ -

Specifies an alternative to for starting a +

Specifies an alternative to for starting a slave node on a remote host; see slave(3).

diff --git a/lib/common_test/test_server/ts_install.erl b/lib/common_test/test_server/ts_install.erl index 09f3da860a..86f16fa072 100644 --- a/lib/common_test/test_server/ts_install.erl +++ b/lib/common_test/test_server/ts_install.erl @@ -268,7 +268,7 @@ add_vars(Vars0, Opts0) -> {Opts, [{longnames, LongNames}, {platform_id, PlatformId}, {platform_filename, PlatformFilename}, - {rsh_name, os:getenv("ERL_RSH", "rsh")}, + {rsh_name, os:getenv("ERL_RSH", "ssh")}, {platform_label, PlatformLabel}, {ts_net_dir, Mounted}, {erl_flags, []}, diff --git a/lib/erl_interface/src/prog/erl_start.c b/lib/erl_interface/src/prog/erl_start.c index 670a5900c9..ba495ac818 100644 --- a/lib/erl_interface/src/prog/erl_start.c +++ b/lib/erl_interface/src/prog/erl_start.c @@ -97,7 +97,7 @@ #endif #ifndef RSH -#define RSH "/usr/bin/rsh" +#define RSH "/usr/bin/ssh" #endif #ifndef HAVE_SOCKLEN_T diff --git a/lib/inets/examples/httpd_load_test/hdlt_slave.erl b/lib/inets/examples/httpd_load_test/hdlt_slave.erl index 5ee005629d..cb39a381af 100644 --- a/lib/inets/examples/httpd_load_test/hdlt_slave.erl +++ b/lib/inets/examples/httpd_load_test/hdlt_slave.erl @@ -44,18 +44,17 @@ %% this to work is that the 'erl' program can be found in PATH. %% %% If the master and slave are on different hosts, start/N uses -%% the 'rsh' program to spawn an Erlang node on the other host. +%% the 'ssh' program to spawn an Erlang node on the other host. %% Alternative, if the master was started as %% 'erl -sname xxx -rsh my_rsh...', then 'my_rsh' will be used instead -%% of 'rsh' (this is useful for systems where the rsh program is named -%% 'remsh'). +%% of 'ssh' (this is useful for systems still using rsh or remsh). %% %% For this to work, the following conditions must be fulfilled: %% -%% 1. There must be an Rsh program on computer; if not an error +%% 1. There must be an ssh program on computer; if not an error %% is returned. %% -%% 2. The hosts must be configured to allowed 'rsh' access without +%% 2. The hosts must be configured to allowed 'ssh' access without %% prompts for password. %% %% The slave node will have its filer and user server redirected @@ -244,7 +243,7 @@ register_unique_name(Number) -> %% Makes up the command to start the nodes. %% If the node should run on the local host, there is -%% no need to use rsh. +%% no need to use ssh. mk_cmd(Host, Name, Paths, Args, Waiter, Prog) -> PaPaths = [[" -pa ", Path] || Path <- Paths], diff --git a/lib/mnesia/examples/bench/README b/lib/mnesia/examples/bench/README index 3648fb59da..b8209b19b8 100644 --- a/lib/mnesia/examples/bench/README +++ b/lib/mnesia/examples/bench/README @@ -46,7 +46,7 @@ you need to: - put the $ERL_TOP/bin directory in your path on all nodes - bind IP adresses to hostnames (e.g via DNS or /etc/hosts) - - enable usage of rsh so it does not prompt for password + - enable usage of ssh so it does not prompt for password If you cannot achieve this, it is possible to run the benchmark anyway, but it requires more manual work to be done for each diff --git a/lib/stdlib/doc/src/slave.xml b/lib/stdlib/doc/src/slave.xml index e53ec8231b..88902b364a 100644 --- a/lib/stdlib/doc/src/slave.xml +++ b/lib/stdlib/doc/src/slave.xml @@ -39,17 +39,17 @@ done through the master.

Slave nodes on other hosts than the current one are started with - the rsh program. The user must be allowed to rsh to + the ssh program. The user must be allowed to ssh to the remote hosts without being prompted for a password. This can - be arranged in a number of ways (for details, see the rsh + be arranged in a number of ways (for details, see the ssh documentation). A slave node started on the same host as the master inherits certain environment values from the master, such as the current directory and the environment variables. For what can be assumed about the environment when a slave is started - on another host, see the documentation for the rsh + on another host, see the documentation for the ssh program.

-

An alternative to the rsh program can be specified on +

An alternative to the ssh program can be specified on the command line to erl(1) as follows:

@@ -166,7 +166,9 @@ slave:start(H, Name, Arg). no_rsh -

There is no rsh program on the computer.

+

No remote shell program was found on the computer. Note + that ssh is used by default, but this can be overridden + with the -rsh flag.

{already_running, Node} diff --git a/lib/stdlib/src/slave.erl b/lib/stdlib/src/slave.erl index 5e8c1a43ea..21b8610b79 100644 --- a/lib/stdlib/src/slave.erl +++ b/lib/stdlib/src/slave.erl @@ -104,18 +104,17 @@ relay1(Pid) -> %% this to work is that the 'erl' program can be found in PATH. %% %% If the master and slave are on different hosts, start/N uses -%% the 'rsh' program to spawn an Erlang node on the other host. +%% the 'ssh' program to spawn an Erlang node on the other host. %% Alternative, if the master was started as %% 'erl -sname xxx -rsh my_rsh...', then 'my_rsh' will be used instead -%% of 'rsh' (this is useful for systems where the rsh program is named -%% 'remsh'). +%% of 'ssh' (this is useful for systems still using rsh or remsh). %% %% For this to work, the following conditions must be fulfilled: %% -%% 1. There must be an Rsh program on computer; if not an error +%% 1. There must be an ssh program on computer; if not an error %% is returned. %% -%% 2. The hosts must be configured to allowed 'rsh' access without +%% 2. The hosts must be configured to allowed 'ssh' access without %% prompts for password. %% %% The slave node will have its filer and user server redirected @@ -286,7 +285,7 @@ register_unique_name(Number) -> %% Makes up the command to start the nodes. %% If the node should run on the local host, there is -%% no need to use rsh. +%% no need to use a remote shell. mk_cmd(Host, Name, Args, Waiter, Prog0) -> Prog = quote_progname(Prog0), @@ -354,7 +353,7 @@ rsh() -> Rsh = case init:get_argument(rsh) of {ok, [[Prog]]} -> Prog; - _ -> "rsh" + _ -> "ssh" end, case os:find_executable(Rsh) of false -> {error, no_rsh}; -- cgit v1.2.3