Next: Multi-hop filename syntax, Up: Usage
To access the file localname on the remote machine machine you would specify the filename /machine:localname. This will connect to machine and transfer the file using the default method. See Default Method.
Some examples of tramp filenames are shown below.
melancholia.
daniel on the machine melancholia. The ~<user>
construct is expanded to the home directory of that user on the remote
machine.
melancholia.
Unless you specify a different name to use, tramp will use the current local user name as the remote user name to log in with. If you need to log in as a different user, you can specify the user name as part of the filename.
To log in to the remote machine as a specific user, you use the syntax
/user@machine:/path/to.file.
That means that connecting to melancholia as daniel and
editing .emacs in your home directory you would specify
/daniel@melancholia:.emacs.
It is also possible to specify other file transfer methods (see Default Method) as part of the filename. This is done by putting the method before the user and host name, as in /method: (Note the trailing colon). The user, machine and file specification remain the same.
So, to connect to the machine melancholia as daniel,
using the ssh method to transfer files, and edit .emacs
in my home directory I would specify the filename
/ssh:daniel@melancholia:.emacs.