Tramp connecttion to non-default port


While working with emacs tramp term is the best solution to make some changes on remote files. I have been using it. For a long time.

It’s easy to connect after M-x tramp-term command root@ip but if you want to connect to server with non-default port like 2222

For this you have to create or edit:

then add information of a server

than open emacs use tramp term just write host1 and enter

Also, you can connect to server by using just ssh host1  from your terminal

That’s it.

For more