Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

1 Answer 1

up vote 7 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 at 8:24

Your Answer

 
discard

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.