Find the answer to your Linux question:
Page 1 of 4 1 2 3 4 LastLast
Results 1 to 10 of 31
Hello, I can ssh into a server and I am told that I can ftp if I can ssh. But I cannot figure out how to do it. I ssh ...
  1. #1
    Just Joined!
    Join Date
    Aug 2010
    Posts
    27

    FTP over SSH?

    Hello,

    I can ssh into a server and I am told that I can ftp if I can ssh.
    But I cannot figure out how to do it.

    I ssh into the server using port 1901, It checks my ssh key, and the server is locked down by IP, I don't have to provide any password.

    I tried ftp, lftp, sftp commands. They either asked for a password or did not connect.

    Is it true that having ssh access automatically gives me ftp access?
    If so, then how can I connect?

    I thank you in advance for your assistance.

  2. #2
    Linux Guru reed9's Avatar
    Join Date
    Feb 2009
    Location
    Boston, MA
    Posts
    4,651
    Not quite. I assume what was meant is sftp, which is part of ssh.

    But most ftp clients are able to handle that, and from the user standpoint, it doesn't appear very different.

  3. #3
    Just Joined!
    Join Date
    Aug 2010
    Posts
    27
    Thanks for helping me again.

    The following command times out:
    Code:
    sftp user@IP
    Do I need to specify a port or the location of my private key?

  4. #4
    Linux Guru reed9's Avatar
    Join Date
    Feb 2009
    Location
    Boston, MA
    Posts
    4,651
    Yes, since you aren't using the default port, you'll need to specify it.

    Code:
    sftp -oPort=1901 user@IP
    You shouldn't have to point to where the key is.

    Is this something you're trying to do just from the command line or are you wanting to browse in a GUI file manager?

    The main linux file managers support sftp. You can generally put in the address bar
    Code:
    sftp://user@IP:port
    Or the console based midnight commander file manager also supports it. Under the drop down menu for the Left or Right pane you can select "Shell link..." and enter user@IP:port.

    Or as I said, ftp apps should also support ssh. I know at least gFTP does, just select ssh2 as the protocol.

  5. #5
    Just Joined! nebjak's Avatar
    Join Date
    Jul 2005
    Location
    Serbia
    Posts
    2
    If you using GNOME, open Nautilus, File -> Connect to Server then chose 'Service type': SSH, fill the form (host, username), and click Connect
    Last edited by nebjak; 12-24-2010 at 09:20 AM.

  6. #6
    Linux User Manko10's Avatar
    Join Date
    Sep 2010
    Posts
    250
    FTP is a completely different protocol and has nothing to do with SSH.
    However, SFTP is (as mentioned before) part of SSH. To be precise: SFTP ist the file transmission protocol of SSH and sshfs is the tool for mounting folders using this protocol. To mount a folder via SSH, run
    Code:
    sshfs user@host:/your/directory mountpoint
    Also don't mix up SFTP and FTPS. The latter is just encrypted FTP, not SSH.
    Refining Linux Advent calendar: “24 Outstanding ZSH Gems

  7. #7
    Just Joined!
    Join Date
    Apr 2006
    Location
    San Jose, CA, USA
    Posts
    5
    Quote Originally Posted by Manko10 View Post
    FTP is a completely different protocol and has nothing to do with SSH.
    However, SFTP is (as mentioned before) part of SSH. To be precise: SFTP ist the file transmission protocol of SSH and sshfs is the tool for mounting folders using this protocol. To mount a folder via SSH, run
    Code:
    sshfs user@host:/your/directory mountpoint
    Also don't mix up SFTP and FTPS. The latter is just encrypted FTP, not SSH.
    sftp -P 1901 user@host

  8. #8
    Linux Enthusiast Mudgen's Avatar
    Join Date
    Feb 2007
    Location
    Virginia
    Posts
    623
    Quote Originally Posted by jimbudler View Post
    sftp -P 1901 user@host
    That's not what the -P option does in sftp. Reed9 gave the right info with -oPort=1901.

    It beats me why the heck port is -p with ssh and -P with scp, and totally baffles me why -P means path to local sftp server in sftp.

  9. #9
    Just Joined!
    Join Date
    Apr 2006
    Location
    San Jose, CA, USA
    Posts
    5
    Although -oPort=1901 is a correct answer, you are incorrect when you say sftp -P 1901 is wrong. Try reading the manual before you say I am wrong. You can also put the line Port=1901 in .ssh/config to get this result.

  10. #10
    Linux Enthusiast Mudgen's Avatar
    Join Date
    Feb 2007
    Location
    Virginia
    Posts
    623
    From the manpage:
    -P sftp_server_path
    Connect directly to a local sftp server (rather than via ssh(1)).
    This option may be useful in debugging the client and server.

    From practice:
    $ sftp -P 22 server
    Attaching to 22...
    exec: 22: No such file or directory

    $ sftp -P /usr/libexec/openssh/sftp-server
    Attaching to /usr/libexec/openssh/sftp-server...
    sftp>
    Last edited by Mudgen; 12-24-2010 at 02:01 AM. Reason: add second example

Page 1 of 4 1 2 3 4 LastLast

Posting Permissions

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