Questions tagged [sftp]

The SSH File Transfer Protocol (SFTP) provides secure file transfer functions using the same infrastructure used by the Secure Shell protocol. It can be seen as a secure replacement for FTP.

For Linux, the following utilities are available, among others:

  • gftp
  • scp
  • sshfs
  • Most file managers, like Konqueror and Nautilus, also support accessing SFTP servers.

For Windows, WinSCP can be used as an SFTP client.

To run an SFTP server that doesn't allow shell access, see Restricting an SCP/SFTP user to a directory.

655 questions
118
votes
11 answers

Uploading directories with sftp?

I'm having some trouble uploading directories(which contain other directories a few levels deep) by sftp. I realize I could work around this by gzipping, but I don't see why that's necessary. Anyway, I try sftp> put bin/ Uploading bin/ to…
Earlz
  • 2,184
  • 2
  • 16
  • 12
100
votes
4 answers

What's the difference between SFTP, SCP and FISH protocols?

I used to think SCP is a tool to copy files over SSH, and copying files over SSH is called SFTP, which is itself a synonym to FISH. But now as I was looking for a Total Commander plugin to do this in Windows, I've noticed that on its page it says…
Ivan
  • 17,368
  • 35
  • 93
  • 118
82
votes
11 answers

Using sftp to Transfer a Directory?

When I try to use sftp to transfer a directory containing files, I get an error message: skipping non-regular file directory_name The directory contains a couple of files and two subdirectories. What am I doing wrong?
haziz
  • 2,231
  • 4
  • 26
  • 37
64
votes
6 answers

Is scp unsafe? Should it be replaced with sftp?

I have over 20 years experience in Un*x, and I have been using scp for immemorial times. scpis over SSH, therefore I consider it as secure as the latter. Now, in my company, where I recently took up a job, the Security Officer says that scp should…
Fabien Haddadi
  • 799
  • 1
  • 5
  • 10
56
votes
10 answers

How to use SFTP on a system that requires sudo for root access & ssh key based authentication?

I want to be able to use SFTP to edit files that require root permissions. I'm using SSH Key based authentication - rsa key on smart card. If the system requires sudo to perform root level commands, How do I get around this? Can I create a way of…
Bruce Kirkpatrick
  • 817
  • 1
  • 6
  • 6
47
votes
6 answers

sftp gives an error: "Received message too long" and what is the reason?

I was able to do sftp yesterday to a RHEL 5.4 box (RedHat) and today I can't. The message is "Received message too long 778199411", and after some investigation, it was due to my RHEL box's .bashrc having a line echo "running .bashrc" -- or echoing…
nonopolarity
  • 2,969
  • 6
  • 31
  • 41
41
votes
3 answers

Restricting an SSH/SCP/SFTP user to a directory

Is there a simple way to restrict an SCP/SFTP user to a directory? All methods that I've come across require me to set a chroot jail up by copying binaries, but I don't think that should be necessary.
user4518
40
votes
7 answers

Is there a program like MobaXTerm for Linux systems? (SFTP GUI browser & terminal)

I am coming from Windows, where I ran the program MobaXTerm. Essentially I used it as an SSH client (though it has other uses). It has a great feature of showing the files and directories on the left hand side, while showing the terminal on the…
The Fluffy Robot
  • 511
  • 1
  • 4
  • 3
38
votes
4 answers

How to pipe a remote file to stdout over scp or sftp?

Using ssh, it is easy to print the contents of a file using ssh host 'cat file.txt' When ssh is disabled, and only SFTP is enabled, running the previous command gives the following error: This service allows sftp connections only. To work-around…
Rob W
  • 898
  • 1
  • 8
  • 17
34
votes
2 answers

How to move files in sftp server?

How can I move a file in sftp server on a different directory? I connect to this server using sftp and then try to move a file using mv myfile.csv /my/dir/myfile.csv but this generates an error. How to to do this?
jrara
  • 2,069
  • 8
  • 23
  • 20
34
votes
8 answers

How to copy symlinks as symlinks from one machine to another?

Let's assume I have two identical systems. On the first system I've created a symbolic link. On the second one I want to copy that symlink via sftp and the symlink shall work the same (i.e if the symlink links to /etc/, after copying it over, only…
TheHidden
  • 788
  • 1
  • 6
  • 24
33
votes
4 answers

Is it possible to grant users sftp access without shell access? If yes, how is it implemented?

I have an array of users who need to just upload files to their set homedirs. I think sftp would suffice, but I don't want them to login via shell. So is it possible? My platform is centos 7, user's homedirs are stored lets say /personal/$user I…
Sollosa
  • 1,887
  • 4
  • 19
  • 32
33
votes
3 answers

Transferring large (8 GB) files over ssh

I tried it with SCP, but it says "Negative file size". >scp matlab.iso xxx@xxx:/matlab.iso matlab.iso: Negative file size Also tried using SFTP, worked fine until 2 GB of the file had transferred, then stopped: sftp> put matlab.iso Uploading…
eimrek
  • 543
  • 1
  • 5
  • 9
32
votes
3 answers

How do I sftp to a server if the username contains @ symbol

I have to sftp to a server to a specific port but the username contains the @ symbol. suppose the user is "[email protected]" and the ftp server is just "example.com" I will end with sftp -oPort:8777 [email protected]@example.com what will obviously…
Duck
  • 4,434
  • 19
  • 51
  • 64
31
votes
2 answers

sftp command to get/download .tar.gz file

I thought I was familiar with sftp commands in unix and upto my knowledge the command to used to download a compressed file from the server is sftp get filename.tar.gz But when I tried this command the file gets emptied, I mean the file size is…
GIRI
  • 877
  • 3
  • 13
  • 17
1
2 3
43 44