Skip to content

Commit fdf6ad9

Browse files
andyclaude
andcommitted
Remove rsh and rcp remote shells
Every connection goes through ssh. A machine still registered with rsh (or rsh/..., rcp) now fails in RCommand with the same "no longer supported; choose ssh" message as telnet and Globus. Site-defined shells in remote_shells.site are unchanged. Drops the rsh/rcp branches of shellCommand/userCommand/copyCommand and the fast-path lists, the rsh checkbox and POST key in Machine Registration, processmachine's rsh key, and EcceShell's rsh display flag. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0167GfjZWhsGJh9at1F9sc9y (cherry picked from commit bef68fc)
1 parent 4f7ac67 commit fdf6ad9

13 files changed

Lines changed: 16 additions & 105 deletions

File tree

‎docs/ENVIRONMENT.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ those settings.
4545
| `ECCE_ESP_RANGE` | Fixes the colour ramp of an electrostatic-potential surface to plus and minus this value instead of scaling to the data. | Positive number, Hartree per e. Unset or invalid: scaled automatically (an invalid value is reported on stderr). |
4646
| `ECCE_NWCHEM_DFT_USE_B3LYP` | NWChem DFT dialog starts with B3LYP instead of VWN5 with Slater exchange. The user can still change it. | The exact text `true`. Default off. |
4747
| `ECCE_JOB_CHECK` | The Organizer, when a project is opened, checks whether calculations shown as submitted or running still have a running `eccejobstore`, and repairs a stuck state. | Set to enable. Default off. |
48-
| `ECCE_TRANSPORT` | Experimental. Overrides Edit > Preferences > External programs > "Run commands without a shell session (built-in ssh)", which is the same as `ssh` when ticked. `direct` runs commands on this machine without a shell session. `ssh` does that too and runs commands on ssh machines over libssh exec channels (needs a build with libssh; otherwise ECCE warns and uses the shell). A source file is run once per connection in the login shell it is written for and its variables applied to every command (aliases and functions it defines are not carried over). File copies (`get`/`put`) use SFTP and job monitoring uses a channel on a session of its own. Machines with a front end, rsh and site-defined shells keep the shell session, and so does socket-comms monitoring (`ECCE_JOB_COMMS`). An unknown ssh host key is refused until accepted once with `ssh <host>`. | `direct`, `ssh`, or `pty` (the shell session, even if the preference is ticked). Default unset: the preference decides, which is off unless ticked. |
48+
| `ECCE_TRANSPORT` | Experimental. Overrides Edit > Preferences > External programs > "Run commands without a shell session (built-in ssh)", which is the same as `ssh` when ticked. `direct` runs commands on this machine without a shell session. `ssh` does that too and runs commands on ssh machines over libssh exec channels (needs a build with libssh; otherwise ECCE warns and uses the shell). A source file is run once per connection in the login shell it is written for and its variables applied to every command (aliases and functions it defines are not carried over). File copies (`get`/`put`) use SFTP and job monitoring uses a channel on a session of its own. Machines with a front end and site-defined shells keep the shell session, and so does socket-comms monitoring (`ECCE_JOB_COMMS`). An unknown ssh host key is refused until accepted once with `ssh <host>`. | `direct`, `ssh`, or `pty` (the shell session, even if the preference is ticked). Default unset: the preference decides, which is off unless ticked. |
4949
| `ECCE_SSH_KEEPALIVE` | Seconds of silence before the libssh transport (`ECCE_TRANSPORT=ssh`) probes an ssh connection. On the job-monitor stream a probe goes out after that many quiet seconds and a host that has sent nothing for three times as long is declared dead: the stream ends and the job master restarts the monitor, instead of waiting for the three-minute heartbeat. The same value sets TCP keepalive on every libssh connection, which ends a blocked command on a link whose host has vanished (the per-command idle timeout stays the main guard). Needs Linux for the stream check; elsewhere only TCP keepalive applies. | Seconds; `0` turns it off. Default `30`. |
5050

5151
## Deployment and site

‎scripts/processmachine‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,6 @@ sub doAccept {
201201
$shell .= ":" if ($shell ne "");
202202
$shell .= "sshpass";
203203
}
204-
if ($contents{"rsh"} eq "true") {
205-
$shell .= ":" if ($shell ne "");
206-
$shell .= "rsh";
207-
}
208204
if ($shell eq "") { $shell = "ssh";} # don't leave empty field
209205
$line .= $shell . "\t";;
210206

‎siteconfig/site_runtime‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ ECCE_JOB_CHECK true
6767

6868
# define the communication scheme to use for job monitoring communications
6969
# possible values are:
70-
# stdio => use the remote shell (ssh, rsh, etc.) for all jobs
70+
# stdio => use the remote shell (ssh or a site-defined shell) for all jobs
7171
# socket => use sockets for all jobs
7272
# socketlocal => use sockets for same domain job launches, stdio
7373
# externally

‎src/apps/machregister/WxMachineRegister.C‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ WxMachineRegister::WxMachineRegister(wxWindow* parent,
8989
p_shellNames.push_back("ssh");
9090
p_shellNames.push_back("ssh/ftp");
9191
p_shellNames.push_back("sshpass");
92-
p_shellNames.push_back("rsh");
9392

9493
this->initialize();
9594
this->loadMachinesList();
@@ -248,9 +247,6 @@ void WxMachineRegister::initialize()
248247
checkbox = (ewxCheckBox*)(this->FindWindowById(ID_CHECKBOX_REMSHELL_SSH_PASS));
249248
p_remshellsCheckboxes.push_back(checkbox);
250249

251-
checkbox = (ewxCheckBox*)(this->FindWindowById(ID_CHECKBOX_REMSHELL_RSH));
252-
p_remshellsCheckboxes.push_back(checkbox);
253-
254250
p_queueAllctnAcctsCheckbox = (ewxCheckBox*)(wxWindow::FindWindowById(ID_CHECKBOX_QUEUE_ALLOCATION));
255251

256252
p_queueAcceptButton = (ewxButton*)(this->FindWindowById( ID_BUTTON_QUEUE_CHANGE));
@@ -1416,7 +1412,6 @@ string WxMachineRegister::collectSettings() const
14161412
ret += "&ssh=" + StringConverter::toString(p_remshellsCheckboxes[0]->IsChecked());
14171413
ret += "&sshftp=" + StringConverter::toString(p_remshellsCheckboxes[1]->IsChecked());
14181414
ret += "&sshpass=" + StringConverter::toString(p_remshellsCheckboxes[2]->IsChecked());
1419-
ret += "&rsh=" + StringConverter::toString(p_remshellsCheckboxes[3]->IsChecked());
14201415

14211416
// Applications - first pass in list of all known codes. Then one by
14221417
// one, pass in info for each code.

‎src/apps/machregister/WxMachineRegisterGUI.C‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ const wxWindowID WxMachineRegisterGUI::ID_CHOICEBOX_QUEUE_MANAGER = wxNewId();
5959
const wxWindowID WxMachineRegisterGUI::ID_SPIN_MACHINE_NUMNODES = wxNewId();
6060
const wxWindowID WxMachineRegisterGUI::ID_PANEL = wxNewId();
6161
const wxWindowID WxMachineRegisterGUI::ID_TEXT_MACHINE_PROC = wxNewId();
62-
const wxWindowID WxMachineRegisterGUI::ID_CHECKBOX_REMSHELL_RSH = wxNewId();
6362
const wxWindowID WxMachineRegisterGUI::ID_SPIN_QUEUE_MAXWALL = wxNewId();
6463
const wxWindowID WxMachineRegisterGUI::ID_CHECKBOX_REMSHELL_SSH = wxNewId();
6564
const wxWindowID WxMachineRegisterGUI::ID_BUTTON_FORM_CLOSE = wxNewId();
@@ -296,11 +295,6 @@ void WxMachineRegisterGUI::CreateControls()
296295
itemCheckBox29->SetFont(wxFont(8, wxSWISS, wxNORMAL, wxBOLD, false, _T("Sans")));
297296
itemBoxSizer26->Add(itemCheckBox29, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3);
298297

299-
ewxCheckBox* itemCheckBox30 = new ewxCheckBox( itemScrolledWindowForm, ID_CHECKBOX_REMSHELL_RSH, _("rsh"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
300-
itemCheckBox30->SetValue(false);
301-
itemCheckBox30->SetFont(wxFont(8, wxSWISS, wxNORMAL, wxBOLD, false, _T("Sans")));
302-
itemBoxSizer26->Add(itemCheckBox30, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3);
303-
304298
ewxPanel* itemPanel34 = new ewxPanel( itemScrolledWindowForm, ID_PANEL_WXMACHINEREGISTER_APPLICATIONS, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxTAB_TRAVERSAL );
305299
itemBoxSizer7->Add(itemPanel34, 0, wxGROW|wxALL, 3);
306300

‎src/apps/machregister/WxMachineRegisterGUI.H‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ public:
149149
static const wxWindowID ID_SPIN_MACHINE_NUMNODES;
150150
static const wxWindowID ID_PANEL;
151151
static const wxWindowID ID_TEXT_MACHINE_PROC;
152-
static const wxWindowID ID_CHECKBOX_REMSHELL_RSH;
153152
static const wxWindowID ID_SPIN_QUEUE_MAXWALL;
154153
static const wxWindowID ID_CHECKBOX_REMSHELL_SSH;
155154
static const wxWindowID ID_BUTTON_FORM_CLOSE;

‎src/apps/machregister/WxMachineRegisterGUI.pjd‎

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1716,58 +1716,6 @@ Computer Logical Name
17161716
<string name="proxy-Custom arguments">""</string>
17171717
<string name="proxy-Custom ctor arguments">""</string>
17181718
</document>
1719-
<document>
1720-
<string name="title">"wxCheckBox: ID_CHECKBOX_REMSHELL_RSH"</string>
1721-
<string name="type">"dialog-control-document"</string>
1722-
<string name="filename">""</string>
1723-
<string name="icon-name">"checkbox"</string>
1724-
<long name="is-transient">0</long>
1725-
<long name="owns-file">1</long>
1726-
<long name="title-mode">0</long>
1727-
<long name="parent">160303472</long>
1728-
<long name="locked">0</long>
1729-
<string name="created">"23/5/2006"</string>
1730-
<string name="proxy-type">"wbCheckBoxProxy"</string>
1731-
<string name="proxy-Id name">"ID_CHECKBOX_REMSHELL_RSH"</string>
1732-
<long name="proxy-Id value">10011</long>
1733-
<string name="proxy-Class">"wxCheckBox"</string>
1734-
<string name="proxy-Member variable name">""</string>
1735-
<string name="proxy-Label">"rsh"</string>
1736-
<bool name="proxy-Initial value">0</bool>
1737-
<string name="proxy-Help text">""</string>
1738-
<string name="proxy-Tooltip text">""</string>
1739-
<string name="proxy-Data variable">""</string>
1740-
<string name="proxy-Data validator">""</string>
1741-
<string name="proxy-Background colour">""</string>
1742-
<string name="proxy-Foreground colour">""</string>
1743-
<string name="proxy-Font">"8, wxSWISS, wxNORMAL, wxBOLD, false, Sans"</string>
1744-
<bool name="proxy-Hidden">0</bool>
1745-
<bool name="proxy-Enabled">1</bool>
1746-
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
1747-
<bool name="proxy-wxALIGN_RIGHT">0</bool>
1748-
<bool name="proxy-wxCHK_2STATE">1</bool>
1749-
<bool name="proxy-wxCHK_3STATE">0</bool>
1750-
<bool name="proxy-wxCHK_ALLOW_3RD_STATE_FOR_USER">0</bool>
1751-
<bool name="proxy-wxWANTS_CHARS">0</bool>
1752-
<string name="proxy-Custom styles">""</string>
1753-
<long name="proxy-X">-1</long>
1754-
<long name="proxy-Y">-1</long>
1755-
<long name="proxy-Width">-1</long>
1756-
<long name="proxy-Height">-1</long>
1757-
<string name="proxy-AlignH">"Centre"</string>
1758-
<string name="proxy-AlignV">"Centre"</string>
1759-
<long name="proxy-Stretch factor">0</long>
1760-
<long name="proxy-Border">3</long>
1761-
<bool name="proxy-wxLEFT">1</bool>
1762-
<bool name="proxy-wxRIGHT">1</bool>
1763-
<bool name="proxy-wxTOP">1</bool>
1764-
<bool name="proxy-wxBOTTOM">1</bool>
1765-
<bool name="proxy-wxSHAPED">0</bool>
1766-
<bool name="proxy-0">0</bool>
1767-
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
1768-
<string name="proxy-Custom arguments">""</string>
1769-
<string name="proxy-Custom ctor arguments">""</string>
1770-
</document>
17711719
</document>
17721720
<document>
17731721
<string name="title">"wxPanel: ID_PANEL_WXMACHINEREGISTER_APPLICATIONS"</string>

‎src/comm/commtools/EcceShell.C‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,8 +454,7 @@ string EcceShell::remoteShell
454454

455455
string theShell = RCommand::commandShell(refMachine->fullname(),shell,user);
456456

457-
bool displayFlag = theShell=="rsh" || theShell.find("rsh/")==0 ||
458-
!presetDisplayFlag;
457+
bool displayFlag = !presetDisplayFlag;
459458

460459
bool xsetFlag = displayFlag || theShell=="" || theShell=="ssh" ||
461460
theShell=="sshpass" || theShell.find("ssh/")==0 ||

‎src/comm/commtools/RunMgmt.C‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ bool RunMgmt::registerLocalMachine(string& msg)
324324
model = "O2";
325325

326326
settings += "&vendor=" + vendor + "&model=" + model;
327-
settings += "&processor=Unspecified&procs=1&nodes=1&rsh=false&ssh=true&sshftp=false";
327+
settings += "&processor=Unspecified&procs=1&nodes=1&ssh=true&sshftp=false";
328328

329329
// Within PNNL, use the AFS installations of codes as defined in the
330330
// CONFIG.<vendor> files.

‎src/comm/rcommand/RCommand.C‎

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,8 @@ bool RCommand::isSameDomain(const string& machine)
831831
string RCommand::removedShellMessage(const string& remShell)
832832
{
833833
string name = remShell.substr(0, remShell.find('/'));
834-
if (name=="telnet" || name=="Globus" || name=="Globus-ssh")
834+
if (name=="telnet" || name=="Globus" || name=="Globus-ssh" ||
835+
name=="rsh" || name=="rcp")
835836
return "The remote shell '" + name + "' is no longer supported by ECCE; "
836837
"edit this machine in Machine Registration and choose ssh.";
837838
return "";
@@ -924,10 +925,7 @@ string RCommand::shellCommand(const string& remShell, const string& machine,
924925
for (it=0; sshpass_opts[it]!=(char*)0; it++)
925926
argv[argc++] = (char*)sshpass_opts[it];
926927

927-
} else if (remShell=="rsh" || remShell.find("rsh/")==0)
928-
theShell = "rsh";
929-
930-
else {
928+
} else {
931929
theShell = RCommand::userShellCommandArgs(remShell, proxyAuth, argc,argv);
932930
if (theShell=="ssh" || (theShell.find("/ssh")!=string::npos &&
933931
theShell.find("/ssh")==theShell.length()-4)) {
@@ -1031,9 +1029,6 @@ string RCommand::userCommand(const string& command,
10311029
for (it=0; sshpass_opts[it]!=(char*)0; it++)
10321030
argv[argc++] = (char*)sshpass_opts[it];
10331031

1034-
} else if (remShell=="rsh" || remShell.find("rsh/")==0) {
1035-
theShell = "rsh";
1036-
10371032
} else {
10381033
theShell = RCommand::userShellCommandArgs(remShell, proxyAuth, argc,argv);
10391034
if (theShell=="ssh" || (theShell.find("/ssh")!=string::npos &&
@@ -1329,13 +1324,6 @@ string RCommand::copyCommand(const string& remShell, const bool& isRemote,
13291324

13301325
argv[argc++] = (char*)minr;
13311326

1332-
} else if (remShell=="rcp" ||
1333-
(remShell.find("/rcp")!=string::npos &&
1334-
remShell.find("/rcp")==remShell.length()-4) ||
1335-
remShell=="rsh") {
1336-
theCopy = "rcp";
1337-
argv[argc++] = (char*)minr;
1338-
13391327
} else if (remShell=="ftp" ||
13401328
(remShell.find("/ftp")!=string::npos &&
13411329
remShell.find("/ftp")==remShell.length()-4)) {
@@ -1370,8 +1358,6 @@ string RCommand::copyToShell(const string& copyCmd)
13701358

13711359
if (copyCmd=="scp" || copyCmd=="sftp")
13721360
shellCmd = "ssh";
1373-
else if (copyCmd == "rcp")
1374-
shellCmd = "rsh";
13751361

13761362
return shellCmd;
13771363
}
@@ -2632,10 +2618,7 @@ string RCommand::commandShell(const string& machine, const string& remShell,
26322618
if (!RCommand::isRemote(machine, remShell, userName) ||
26332619
remShell=="" || remShell=="ssh" || remShell=="sshpass" ||
26342620
remShell.find("ssh/")==0 || (remShell.find("/ssh")!=string::npos &&
2635-
remShell.find("/ssh")==remShell.length()-4) ||
2636-
remShell=="rsh" || remShell.find("rsh/")==0 ||
2637-
(remShell.find("/rsh")!=string::npos &&
2638-
remShell.find("/rsh")==remShell.length()-4)) {
2621+
remShell.find("/ssh")==remShell.length()-4)) {
26392622
// empty -- done this way for speed of evaluation
26402623
} else {
26412624
string shellMatch = remShell + ":";
@@ -2708,8 +2691,7 @@ string RCommand::argsToCommand(const string& command, const string& args,
27082691

27092692
if (!isRemote ||
27102693
remShell=="" || remShell=="ssh" || remShell=="sshpass" ||
2711-
remShell.find("ssh/")==0 ||
2712-
remShell=="rsh" || remShell.find("rsh/")==0) {
2694+
remShell.find("ssh/")==0) {
27132695
// empty -- done this way for speed of evaluation
27142696
} else {
27152697
string shellMatch = remShell + ":";
@@ -2777,10 +2759,7 @@ string RCommand::argsToCommand(const string& command, const string& args,
27772759
if (!isRemote ||
27782760
theShell=="ssh" || theShell=="sshpass" ||
27792761
theShell.find("ssh/")==0 || (theShell.find("/ssh")!=string::npos &&
2780-
theShell.find("/ssh")==theShell.length()-4) ||
2781-
theShell=="rsh" || theShell.find("rsh/")==0 ||
2782-
(theShell.find("/rsh")!=string::npos &&
2783-
theShell.find("/rsh")==theShell.length()-4))
2762+
theShell.find("/ssh")==theShell.length()-4))
27842763
commandWithArgs = command;
27852764

27862765
if (args != "") {

0 commit comments

Comments
 (0)