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 often use Places > Connect to server... and always connect with SSH.

The Connect to Server dialog box always selects Service type as Public FTP by default.

Is there a way to change this so Service type always defaults to SSH?

share|improve this question
1  
Pavlos Gs answer should be helpful. But I think you could actually file this as a bug, since ssh is much more relevant than ftp. –  Jo-Erlend Schinstad Aug 16 '11 at 15:13

2 Answers 2

up vote 3 down vote accepted

I don't see any relevant parameter, config file or gconf setting available in order to change the default options, so i guess you'll have to recompile the nautilus package.

You should download the source package first and probably edit /src/nautilus-connect-server-dialog.c.

More info on how to compile nautilus can be found on the following links:

http://ubuntuforums.org/showthread.php?t=1049716

http://ubuntuforums.org/showthread.php?t=1678656

share|improve this answer

Thanks Pavlos G. for the info and links. After reading the links and a few more Google searches I recompiled with the following:

sudo apt-get build-dep nautilus # get build dependencies 
apt-get source nautilus # get nautilus source
cd nautilus-2.32.2.1
patch -p1 < ../sftp_default.patch # apply patch to set sftp (SSH) to default protocol
dpkg-buildpackage -rfakeroot -uc -b # build .deb files
cd ..
sudo dpkg -i *.deb # install .deb files

Where sftp_default.patch contains:

diff -ruN nautilus-2.32.2.1.a/src/nautilus-connect-server-dialog.c nautilus-2.32.2.1.b/src/nautilus-connect-server-dialog.c
--- nautilus-2.32.2.1.a/src/nautilus-connect-server-dialog.c    2011-08-21 16:00:30.720119356 +1200
+++ nautilus-2.32.2.1.b/src/nautilus-connect-server-dialog.c    2011-08-21 16:00:36.250910768 +1200
@@ -96,9 +96,9 @@
 /* Remember to fill in descriptions below */
 static struct MethodInfo methods[] = {
    /* FIXME: we need to alias ssh to sftp */
-   { "sftp",  SHOW_PORT | SHOW_USER },
+   { "sftp",  DEFAULT_METHOD | SHOW_PORT | SHOW_USER },
    { "ftp",  SHOW_PORT | SHOW_USER },
-   { "ftp",  DEFAULT_METHOD | IS_ANONYMOUS | SHOW_PORT},
+   { "ftp",  IS_ANONYMOUS | SHOW_PORT},
    { "smb",  SHOW_SHARE | SHOW_USER | SHOW_DOMAIN },
    { "dav",  SHOW_PORT | SHOW_USER },
    /* FIXME: hrm, shouldn't it work? */

To check to see if I could restore Nautilus to the default Ubuntu package, I used:

sudo apt-get install --reinstall nautilus

Works like charm, thanks again Pavlos G.

I found http://ubuntuforums.org/showthread.php?t=101097 to be helpful with recompiling the package.

share|improve this answer
    
glad to hear that ;-) –  Pavlos G. Aug 23 '11 at 3:05

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.