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.

665 questions
33
votes
5 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,929
  • 4
  • 20
  • 38
25
votes
2 answers

sftp - how to only copy files from folder that don't exist in destination folder

I am wondering if it's possible to get files with sftp, but prevent it from re-downloading files that already exist in the destination folder?
15
votes
5 answers

How to remove multiple files using sftp

This post is about removing muliple files from the remote server, when sftp password less connection is setup. I have the code as below. Only first file in the variable $file_list gets deleted, when I have the variable set as, $file_list="file1…
bhawna
  • 153
13
votes
4 answers

How to list files and only files via SFTP?

I can list file names actually but a lot of unwanted stuff comes from there also. > echo "ls *.txt" | sftp user@host:/dir Connected to 1.1.1.1. Changing to: /dir sftp> ls *.txt 1.txt 2.txt 3.txt Is there a proven/reliable way to list files and only…
12
votes
2 answers

cat a remote file from sftp

I'm in an SFTP session and navigated to a deep directory. I did ls -l, saw a small file, and want to just read it. I would prefer to do it while I'm still in SFTP, rather than starting up a new terminal, doing SSH, navigating to that deep directory,…
k314159
  • 445
8
votes
2 answers

Using mget to download multiple files from sftp

I have some R code, and at one part, I'm connecting to an sftp and trying to download some files. The files that need to be downloaded are determined by the R code and can either be only one or multiple. I'm trying to use mget to download the files,…
ytk
  • 183
4
votes
2 answers

What is the meaning of "stat" in the SFTP error message "Couldn't stat remote file"

I've seen this when using SFTP; for example when I try to remove a file that isn't on the remote server: sftp> RM coa.dat.gz Couldn't stat remote file: No such file or directory Removing coa.dat.gz Couldn't delete file: No such file or…
JSchaefer
  • 143
4
votes
2 answers

upload to sftp batch mode

I need to upload files to an SFTP server as part of an automated pipeline process (so can not be interactive). I do not have ssh access so I can not use scp or rsync. I have had some success using the solution proposed in this answer: sftp…
3
votes
2 answers

SFTP mget and get command to copy multiple folders or files to one server directory

I needed to copy multiple folders of same directory using one command. So I did this first, sftp> mget -r folder1 folder2 This command copied folder1 to the destination server but renamed it to folder2. I probably should have done something like the…
3
votes
2 answers

hostkey switch in sftp command

While connecting to a SFTP server on Windows using WinSCP, I need to pass hostkey fingerprint through the -hostkey switch. Is a similar option available in sftp command in Linux?
1
vote
1 answer

How to set up SFTP server that doesn't affect entire machine

I set up chrooted SFTP directories on a RHEL 8 server that also has several websites running on it. When I tried to ssh in this morning, the server said it only accepts SFTP connections. Fortunately, it's a VM so I can connect directly to the…
Chanel
  • 99
1
vote
2 answers

SFTP make copy of remote file without downloading

I have backup space that is accessible by SFTP. I have made a backup in a directory called "mybackup" on this remote storage. I would now like to make a copy of the mybackup directory called "mybackup-copy" also on the remote storage. Is there a way…
artfulrobot
  • 2,929
1
vote
1 answer

Colon after user in SFTP connection string

I've come across using a value separated by a colon after the user in a connection string, e.g. sftp user:abc@hostname. Can anyone tell me what it should do? I haven't been able to figure it out by using it, and googling for it just turns up the use…
neomanyouth
  • 13
  • 1
  • 3
1
vote
1 answer

File transfer from linux to windows share folder on daily basis

I can transfer file from linux to linux. Also can transfer from linux to windows or windows to linux by using cmd pscp command. But system asks for password. So I have tried winscp batch command for skipping password. Now I want to transfer file…
Hosain Ahmed
  • 11
  • 1
  • 3
1
vote
1 answer

I am getting an error while doing SFTP

I am trying to send a file using SFTP. But getting below error when connecting: /opt/qrmftp/.ssh/config line 2: Bad SSH2 Mac spec 'hmac-sha1,hmac-sha1-96,hmac-sha256,hmac-sha2-256,hmac-sha256@ssh.com'. Couldn't read packet: Connection reset by peer
Ramkumar
  • 113
1
2 3