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.

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.

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

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...)

share|improve this answer
    
thx man, this is perfect! It used SSH authentication for me (because of sftp maybe). –  Regisz Jan 27 '12 at 10:14
add comment

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.