A remote host can mount with nautilus:

nautilus sftp://<target-host>

But, in this case a nautilus window is opened. I would like to use this command in a script.

How can I avoid window opening?

Remark: I know sshfs, but I would like to use nautilus because I would like to see the connection in sidebar of nautilus and sshfs can cause problem if the remote host is down.


You can use the command:

gvfs-mount sftp://user@targethost

to mount a remote location by SFTP on the console. It also shows up in Nautilus (you can unmount it there) but it doesn't open a window automatically.

You have to enter the password for the remote host interactively when you use this command. (I don't know how to supply it by the command line or if gvfs-mount does make use of SSH keys. Would be nice if somebody could add this...)

  • 1
    thx man, this is perfect! It used SSH authentication for me (because of sftp maybe). – Regisz Jan 27 '12 at 10:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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