Skip to content

Opening from a bastion host (external connections)

The local client of a bastion host such as JumpServer can launch ShellRS to open a terminal the way it launches Xshell, or to open SFTP the way it launches WinSCP: set ShellRS as the SSH client or the SFTP client, with the arguments written as for Xshell or WinSCP. When ShellRS gets an ssh:// link, it opens a terminal tab and connects; when it gets an sftp:// link, it opens an SFTP tab:

ShellRS ssh://user[:password]@address[:port]
ShellRS -url ssh://user[:password]@address[:port] -newtab tab-name
ShellRS -newtab tab-name session-file.xsh
ShellRS sftp://user[:password]@address[:port]
ShellRS /sessionname=tab-name sftp://user[:password]@address[:port]
ShellRS /ini=… user@address[:port] /rawsettings PasswordPlain=password
  • ShellRS understands Xshell’s -url (the link), -newtab (the tab name; the address if it isn’t given) and -newwin (ignored: ShellRS has only one window), and WinSCP’s /sessionname=tab-name (which can also be written -sessionname=), in any letter case; other options such as /newinstance and /ini=nul are ignored. Only ssh:// and sftp:// are supported, and the port defaults to 22. Special characters in the username and password can be escaped by URL rules (@ as %40); a username that itself contains @ also works, since only what follows the last @ is the address. As in Xshell, an ssh:// link also takes /, ? and # unescaped in the username and password, as in ssh://account@domain/target-address/root/client:password@bastion-host:port; as in WinSCP, an sftp:// link’s path starts at its first /, so a / in the username has to be written %2F. The path in an sftp:// link (which WinSCP uses to choose the folder to open) isn’t read yet; the remote side opens the home folder as usual.
  • WinSCP addresses without sftp://: bastion hosts such as NSFOCUS OSMS launch WinSCP with just user@address:port (which WinSCP opens with SFTP) and the password in PasswordPlain= after /rawsettings. ShellRS opens an SFTP tab for it too, using the username as it is, # included. When PasswordPlain is Base64 that decodes to text, it’s decoded, as OSMS writes it; otherwise it’s the password as it is, as in WinSCP. A password in the address itself comes first. Other switches such as /ini= and /hostkey=, and the rest of /rawsettings, are ignored; the host key is confirmed the first time and remembered, as usual.
  • Xshell session files: bastion hosts such as NSFOCUS OSMS write the host to connect to into an Xshell session file (.xsh) and launch ShellRS -newtab tab-name C:\…\session.xsh. ShellRS reads only the protocol, address, port, username and password from it and opens a terminal tab, as for an ssh:// link; the terminal type, colors and the rest follow ShellRS’s own settings. Only SSH sessions are supported, and the port defaults to 22. The username is used as it is, # and other characters included. The password is read as Base64, the way OSMS writes it; a session saved by Xshell itself keeps its password encrypted, which can’t be read, so you’re asked if the server wants one. The ShellRS that the bastion host launches reads the file right away, so it doesn’t matter if the bastion host deletes it afterwards. If a link is given as well, the link is used.
  • The tab fills the window: when an external connection opens, the host list on the left collapses automatically (as with ⌘B); double-click the tab to show it again, or press ⌘B (Ctrl+Shift+B on Windows and Linux).
  • External connection, not saved: it stays out of the host list, the start page’s Recent list and the database, and is gone once its terminal and SFTP tabs are all closed. Its tab menu has no “Edit host…”; everything else (“Duplicate session”, “Open SFTP”, “Reconnect”) works as for a saved host.
  • One channel only: many bastion hosts end the whole session when a second channel opens on the same connection. An SFTP tab opens only one anyway; a terminal doesn’t detect the host’s system (its tab shows the first letter of the name), and the right sidebar has only Snippets and the AI assistant (its commands always run in the terminal, and it can’t read files): History, Files, tmux, Docker, Kubernetes, Services, Processes, Network, Monitor and GPU/NPU all need another channel, so they aren’t offered here.
  • The password in the link stays only in memory, never in the keychain, and is reused when reconnecting; if the link has no password and the server wants one, you’re asked. The first time you connect to a bastion host, you trust its host key, which is recorded in ShellRS’s own known_hosts and not asked about again.
  • Bastion hosts with only old algorithms (such as an NSFOCUS OSMS that supports only aes128-cbc): the first connection says the server supports only old algorithms; click “Allow and reconnect” to connect (see “Advanced” under “Hosts” for what that allows). It’s remembered on this computer by the bastion host’s address and port, so the next time the bastion host launches ShellRS it connects without asking. It doesn’t sync, and for now there’s no way to remove it. “Quick connect…” from the title bar works the same way.
  • When ShellRS is already running, the link goes to the running ShellRS, its window comes to the front, and no second ShellRS starts. If the link has a problem (not ssh:// or sftp://, no username or address, a wrong port), or the session file can’t be read or isn’t an SSH session, ShellRS shows a notification saying why.
  • The program for the bastion host to launch:
    • Windows: shellrs.exe in the installation folder (by default %LOCALAPPDATA%\Programs\ShellRS\shellrs.exe), or in the portable folder for the portable copy. Don’t use the shellrs.exe on the PATH (the one in the portable copy’s bin included): that’s the external CLI’s copy.
    • macOS: /Applications/ShellRS.app/Contents/MacOS/shellrs. Don’t use open -a ShellRS --args …: when ShellRS is already running, the system drops the arguments.
    • Linux: the AppImage itself, or shellrs in the portable folder for the portable copy.
  • The external CLI’s shellrs hosts list lists external connections too ("temporary": true in the JSON, “(not saved)” in the table’s group column). While the tabs are open, an agent can use the connection’s ID to run commands and transfer files, and the ID stays the same all that time. Once the tabs close, the ID stops working; the next time the bastion host launches ShellRS (even for the same asset), it’s a new external connection with a new ID. As with saved hosts, each command logs in again with the username and password from the link; if the bastion host passed a one-time token, that login is refused. In that case, use shellrs exec --terminal instead, which runs the command in the terminal the external connection already has open (see “External CLI”).
  • A password in command-line arguments is visible in this computer’s process list; that comes with how the bastion host passes arguments.