1

Let's say I have a user on a remote machine called wvxvw with a password password. The remote machine runs inside a VirtualBox, it is set to forward ports 22 to 3022. This is my ~/.ssh/config on the host:

Host ubuntu-server
    HostName 127.0.0.1
    Port 3022
    User wvxvw

I can browse directories on the guest via /ssh:ubuntu-server: path. wvxvw is in the sudoers group on the remote machine. Now, let's say I want to edit files that require root permissions on the guest machine. How do I open, say a /etc/default/ directory as root? I've tried couple of options, but that didn't work: /sudo:wvxvw@127.0.0.1:/etc/default goes back to the host machine. If I specify port, then the address is misinterpreted as something else. So... how do I?

  • possible duplicate of [Open file via SSH and Sudo with Emacs](http://stackoverflow.com/questions/2177687/open-file-via-ssh-and-sudo-with-emacs) – legoscia Jul 26 '13 at 16:08
  • Or perhaps this one: http://stackoverflow.com/questions/7832837/how-can-i-use-emacs-tramp-to-ssh-to-a-remote-host-and-edit-a-file-as-another-use?rq=1 – legoscia Jul 26 '13 at 16:09
  • @legoscia oh... should've known better to search for this. Just for the record, the answer by phils worked for me. –  Jul 26 '13 at 16:30

0 Answers0