Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use "Connect to server" option to sftp to remote computers, as a user which has sudoer privileges. But then, I cannot get root privileges to modify system files. How can I do this?

(I know i can use ssh and then use sudo, but I was wondering if there's a quicker method.)

share|improve this question
up vote 8 down vote accepted

Hya, bad news for you. The short answer is that you can't — you get the privileges of the user you logged in as.

The long answer follows herewith… The 'connect to server' option is nothing but a pretty gui that issues simple sftp commands under the hood, once connected to a server via an ssh like transport protocol. A list of these commands is available if you enter a terminal window and enter man sftp. You'll see the commands available to 'connect to server' in the section 'interactive commands' of the manpage.

They are limited to bye cd chgrp chmod chown df exit get help lcd lls lmkdir ln lpwd ls lumask mkdir progress put pwd quite rename rm rmdir symlink and !. You may recognise many of them from ftp, if you ever command-line ftp'd. Some new cool additions, but as you can see none of them supports the concept of RunAs, or sudo.

Gaining elevated privileges was simply never designed into the protocol.

share|improve this answer
such a bad news to me as well :( Is there any alternate to this. As recommended I always keep the root login disabled in my sshd_config. – user01 Feb 28 '14 at 8:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.