02 December 2011

Working on remote files using ssh and sudo in emacs/tramp

Working with emacs is always fun.
To work on remote files you will find enough information at Tramp tutorial, here i am talking about working with remote server and then use sudo to write some file.

For example : You are connecting remote machine using ssh as user1 and then you need to write file using user2 (actually sudo -u user2 filename) or better to say multiple hoping.

,-------------------------------------------------
| user1@remotehost ---> sudo -u user2 at remotehost filename
`-------------------------------------------------

Cool then, you need to add following line in your .emacs file.

set-default 'tramp-default-proxies-alist (quote ((".*" nil "/ssh:user1@%h:"))))
after saving and evaluating use

C-x C-f sudo:user2@remotehost:filename_path

Happy Hacking
gnumonk

1 comment:

Antony Christ said...

MyCaseStudyHelp.Com is an online assignment help and writing service provider for Graduate and Post Graduate students of universities. It provides quick solutions to the assignment, essay, dissertation and thesis related problems of students at an affordable service price on the following subjects: MBA, Nursing, Law, Engineering &c. Thousands of students availed our services and are happy and satisfied. Why are you lagging behind? Get more info at: https://www.mycasestudyhelp.com/assignment/