The following is an excerpt from the Quick Start Guide for Tramp, which is built-in to Emacs 26:
https://www.gnu.org/software/emacs/manual/html_node/tramp/Quick-Start-Guide.html
Tramp extends the Emacs file name syntax by a remote component. A remote file
name looks always like /method:user@host:/path/to/file.
You can use remote files exactly like ordinary files, that means you could open
a file or directory by C-x C-f /method:user@host:/path/to/file <RET>, edit the
file, and save it. You can also mix local files and remote files in file
operations with two arguments, like copy-file or rename-file. And finally, you
can run even processes on a remote host, when the buffer you call the process
from has a remote default-directory.
The O.P. has indicated in a comment that using /method:user@host:/path/to/file
has resolved the issue.
Example using ssh
and a non-standard port (2222) to connect to the root default directory:
/ssh:user@host#2222:
Example using ssh
to open a file with a non-standard port (2222):
/ssh:user@host#2222:/path/to/file
Here is an example to connect to the root default directory using eshell
with a non-standard port (2222):
(let ((default-directory "/ssh:user@host#2222:"))
(eshell))
Here is an example to connect to the root default directory using shell
with a non-standard port (2222):
(let ((default-directory "/ssh:user@host#2222:"))
(shell))
To login automatically using an .authinfo
file, here is a sample entry in that file:
machine HOST login USER password PWD
To assist with logging in automatically with a non-standard port (2222), one can use an appropriate entry in the ~/.ssh/config
file, which can include other attributes; e.g., HostName and User. https://emacs.stackexchange.com/a/31339/2287
Host 12.34.567.89
Port 2222