Page 3 of 6 FirstFirst 12345 ... LastLast
Results 21 to 30 of 57

Thread: How can I connect to SFTP using Nautilus (Files)

  1. #21
    Join Date
    Mar 2011
    Location
    U.K.
    Beans
    Hidden!
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: How can I connect to SFTP using Nautilus (Files)

    This is one tutorial I came across ..

    https://brinchmann.wordpress.com/201...h-in-nautilus/

    it refers to ssh-add and I was about to post it here.

    And I vaguely recollect reading a thread about proxy settings / gnome keys being one cause of failure to connect but I've lost the link.

    P.S. Back to Thunar. Does that work?
    Last edited by dragonfly41; July 30th, 2021 at 04:51 PM.

  2. #22
    Join Date
    May 2006
    Location
    Switzerland
    Beans
    2,907
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: How can I connect to SFTP using Nautilus (Files)

    Quote Originally Posted by Paddy Landau View Post
    This seems to be unreasonably difficult for something so well established!
    Let's do the basics first and try to get it working on the command line, because the command line will give us more detailed error messages if something fails. So if you place your key e.g. in ~/.ssh/id_rsa .. does e.g. this command work now?

    Code:
    sftp -P customport remoteuser@remoteserver:/path/to/directory
    Because on the command line even if there is a passphrase then the command line tool itself should ask for it. If that is not even happening then we must have yet another problem.

    Let's do the fancy GUI stuff once we get the basics figured out.

  3. #23
    Join Date
    May 2008
    Location
    United Kingdom
    Beans
    5,263
    Distro
    Ubuntu

    Re: How can I connect to SFTP using Nautilus (Files)

    Quote Originally Posted by dragonfly41 View Post
    This is one tutorial I came across…
    Thanks, but again, that is for an older version of Nautilus. In that version, Nautilus pops up a dialogue where you can enter the important details. The current version doesn't do that — it seems to assume that you don't have important details to enter!

    I'm not going to try Thunar, because then I'd have to be constantly switching between file managers.
    Quote Originally Posted by scorp123 View Post
    Let's do the basics first…
    I found that I had to explicitly tell sftp where the keyfile is, because it wouldn't take if from ~/.ssh/config.
    Code:
    sftp -P [port] -i ~/.ssh/[keyfile] [user]@[host]:/
    The response was:
    Code:
    Enter passphrase for key '/home/paddy/.ssh/[keyfile]':
    [user]@[host]: Permission denied (publickey).
    Connection closed.  
    Connection closed
    I don't know what FileZilla does differently apart from using a converted keyfile. When I retry sftp with the converted keyfile, sftp complains that the key has an invalid format.

    I use a password manager to type the passphrase for me; I use the same entry for FileZilla, so I know that the passphrase is correct. Also, when I type the wrong passphrase, sftp just asks me again for the passphrase, but when I enter the correct one, it thinks for a moment before failing.
    Always make regular backups of your data (and test them).
    Visit Full Circle Magazine for beginners and seasoned Linux enthusiasts.

  4. #24
    Join Date
    May 2006
    Location
    Switzerland
    Beans
    2,907
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: How can I connect to SFTP using Nautilus (Files)

    Let's take a step backwards here. What was the file named when it was given to you? And were any instructions included?

    And when we look inside the file you were given: Does its content look something like this:
    Code:
    -----BEGIN OPENSSH PRIVATE KEY-----
    ...
    ... lots of seemingly random symbols, letters and numbers
    ...
    -----END OPENSSH PRIVATE KEY-----
    ... or something like this:
    Code:
    ssh-rsa AAAAABBBBBCCCCC... very long string of symbols, letters and numbers ... ZZZZZ  remoteuser@server

    Also, while we're at it: Can you please post the output of this command:
    Code:
    ls -alR ~/.ssh
    I want to make sure we're not getting sabotaged by incorrect file permissions. SSH is very picky.

  5. #25
    Join Date
    Mar 2011
    Location
    U.K.
    Beans
    Hidden!
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: How can I connect to SFTP using Nautilus (Files)

    I'm not going to try Thunar, because then I'd have to be constantly switching between file managers.
    The thinking was .. if it works in Thunar then the issue is with Nautilus.
    If not then it is in SSH configuration.
    Process of elimination. Then you can resume focus on on Nautilus.

  6. #26
    Join Date
    May 2008
    Location
    United Kingdom
    Beans
    5,263
    Distro
    Ubuntu

    Re: How can I connect to SFTP using Nautilus (Files)

    Quote Originally Posted by scorp123 View Post
    What was the file named when it was given to you?
    It's provided on their website as text to copy. So, you choose your own file name.
    Quote Originally Posted by scorp123 View Post
    … were any instructions included?
    No. They assume that you know what you're doing, but they do explain how to add it to FileZilla.
    Quote Originally Posted by scorp123 View Post
    … when we look inside the file you were given…
    It looks like this:
    Code:
    -----BEGIN RSA PRIVATE KEY-----
    Proc-Type: 4,ENCRYPTEDDEK-Info: DES-EDE3-CBC,6F2F983101E8D2D6
    
    
    ... lines of excrypted code ...
    -----END RSA PRIVATE KEY-----
    The converted file that FileZilla created looks like this:
    Code:
    PuTTY-User-Key-File-2: ssh-rsa
    Encryption: aes256-cbc
    Comment: imported-openssh-key
    Public-Lines: 12
    ... lines of excrypted code ...
    Private-MAC: ... line of encrypted code ...
    Quote Originally Posted by scorp123 View Post
    … Can you please post the output of this command:
    Here you are. There are no subdirectories, and I've shown only the relevant files. Apart from known_hosts, all files accessible to me only.
    Code:
    $ ls -AlRd ~/.ssh
    drwx------ 2 paddy paddy 4096 Jul 31 13:33 /home/paddy/.ssh
    
    $ ls -AlR ~/.ssh
    -rw------- 1 paddy paddy 2204 Jul 31 13:33 config
    -rw------- 1 paddy paddy 2681 Jul 26 19:08 id_rsa_SiteGround_multisite.ppk
    -rw------- 1 paddy paddy 3311 Jul 26 12:50 id_rsa_SiteGround_multisite.priv
    -rw------- 1 paddy paddy  752 Jul 26 12:50 id_rsa_SiteGround_multisite.pub
    -rw-r--r-- 1 paddy paddy 3740 Jul 30 17:36 known_hosts
    Always make regular backups of your data (and test them).
    Visit Full Circle Magazine for beginners and seasoned Linux enthusiasts.

  7. #27
    Join Date
    May 2006
    Location
    Switzerland
    Beans
    2,907
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: How can I connect to SFTP using Nautilus (Files)

    Quote Originally Posted by Paddy Landau View Post
    Here you are. There are no subdirectories, and I've shown only the relevant files. Apart from known_hosts, all files accessible to me only.
    On my systems this looks like this:
    Code:
    > ls -alR ~/.ssh
    /home/sysadm/.ssh:
    total 43
    drwx------  2 sysadm sysadm    7 Jul 31 14:41 .
    drwxr-x--- 26 sysadm sysadm   67 Jul 31 22:18 ..
    -rw-------  1 sysadm sysadm 3397 Jun 25 04:33 authorized_keys
    -rw-r--r--  1 sysadm sysadm  581 Feb  2 09:42 config
    -rw-------  1 sysadm sysadm 2590 Jul 24  2020 id_rsa
    -rw-r--r--  1 sysadm sysadm  562 Jul 24  2020 id_rsa.pub
    -rw-------  1 sysadm sysadm 7418 Jul  4 23:47 known_hosts

  8. #28
    Join Date
    Mar 2011
    Location
    U.K.
    Beans
    Hidden!
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: How can I connect to SFTP using Nautilus (Files)

    A further outlier experiment:
    Back in post #23 I referred to a link which I lost.

    I have found it.

    Without giving any promises of success, can you run this command and post results for scrutiny:

    gsettings list-recursively org.gnome.system.proxy



  9. #29
    Join Date
    May 2008
    Location
    United Kingdom
    Beans
    5,263
    Distro
    Ubuntu

    Re: How can I connect to SFTP using Nautilus (Files)

    Quote Originally Posted by dragonfly41 View Post
    gsettings list-recursively org.gnome.system.proxy
    Here are the results.
    Code:
    org.gnome.system.proxy ignore-hosts ['localhost', '127.0.0.0/8', '::1']
    org.gnome.system.proxy use-same-proxy true
    org.gnome.system.proxy mode 'none'
    org.gnome.system.proxy autoconfig-url ''
    org.gnome.system.proxy.http use-authentication false
    org.gnome.system.proxy.http enabled false
    org.gnome.system.proxy.http authentication-password ''
    org.gnome.system.proxy.http port 8080
    org.gnome.system.proxy.http host ''
    org.gnome.system.proxy.http authentication-user ''
    org.gnome.system.proxy.https port 0
    org.gnome.system.proxy.https host ''
    org.gnome.system.proxy.ftp port 0
    org.gnome.system.proxy.ftp host ''
    org.gnome.system.proxy.socks port 0
    org.gnome.system.proxy.socks host ''
    EDIT: See my next post
    Last edited by Paddy Landau; August 1st, 2021 at 09:26 AM.
    Always make regular backups of your data (and test them).
    Visit Full Circle Magazine for beginners and seasoned Linux enthusiasts.

  10. #30
    Join Date
    May 2008
    Location
    United Kingdom
    Beans
    5,263
    Distro
    Ubuntu

    Re: How can I connect to SFTP using Nautilus (Files)

    Things have changed.

    I decided to delete the old key, and recreate it from scratch, but this time without a password. Maybe the password was a limiting factor? Maybe the key was corrupted?

    This helped.

    The website accepted my new key and generated a brand new user. I amended ~/.ssh/config with the new username, discarding the old username.

    I've made significant progress.

    FileZilla still works, obviously with the new username and key.

    My alias in ~/.ssh/config for this host is called sg. This now works:
    Code:
    $ sftp sg
    Connected to sg.
    I can access the remote files normally.
    (Phew!)

    Now, Nautilus does the following.
    Code:
    sftp://[username]@[host]:[port]/
    This still gives, "Unable to access location. Permission denied.[/code]

    However, putting this in gives a new error.
    Code:
    sftp://sg/
    This prompts for the password, thinks for a while, and says, "Could not display sg (sftp). The file is of an unknown type."

    So, that's progress, I guess. I just don't know how to proceed from here.

    Thank you for all the time that you've put into this so far!
    Always make regular backups of your data (and test them).
    Visit Full Circle Magazine for beginners and seasoned Linux enthusiasts.

Page 3 of 6 FirstFirst 12345 ... LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •