# Sftp File Transfer Protocol

**URL:** <https://forums.rockylinux.org/t/sftp-file-transfer-protocol/14022>\
**Category:** Rocky Linux Help & Support\
**Created:** [May 12, 2024, 10:30pm UTC](https://forums.rockylinux.org/t/sftp-file-transfer-protocol/14022 "2024-05-12T22:30:24Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbkt23](https://avatars.discourse-cdn.com/v4/letter/j/9fc29f/32.png) [@jbkt23](https://forums.rockylinux.org/u/jbkt23)\
**Post date:** [May 12, 2024, 10:30pm UTC](https://forums.rockylinux.org/t/sftp-file-transfer-protocol/14022/1 "2024-05-12T22:30:24Z")

</div>

Reading the release notes for “9.4” I see that the command “scp” is nolonger possible and sftp is now the recommended means of secure file transfer. I read the man page for sftp but there are no usage examples. I have not used ftp at the command line since the 90’s and thus have forgotten all I knew.  
Do I assume to transfer a file between machines on the same network that the command would be something like this:

```auto
cd <to folder with data to transfer>
sftp <some file> user@machine:<path to destination>

```

I don’t do transfers outside my tiny lan.

---

<div class="post-metadata">

**Author:** ![label](https://avatars.discourse-cdn.com/v4/letter/l/c5a1d2/32.png) [@label](https://forums.rockylinux.org/u/label)\
**Post date:** [May 13, 2024, 12:47am UTC](https://forums.rockylinux.org/t/sftp-file-transfer-protocol/14022/2 "2024-05-13T00:47:32Z")

</div>

I’m not sure where you’re seeing it’s no longer possible. The sftp protocol is now used for scp in 9. You can still use scp without any issues.

`man scp` and scroll down to history.

```auto
Since OpenSSH 8.8 (8.7 in Red Hat/Fedora builds),
scp has use the SFTP protocol for transfers by default.

```

---

<div class="post-metadata">

**Author:** ![jlehtone](https://avatars.discourse-cdn.com/v4/letter/j/e9a140/32.png) [@jlehtone](https://forums.rockylinux.org/u/jlehtone)\
**Post date:** [May 13, 2024, 9:56am UTC](https://forums.rockylinux.org/t/sftp-file-transfer-protocol/14022/3 "2024-05-13T09:56:25Z")

</div>

> [@jbkt23](#):
>
> Reading the release notes for “9.4” I see that the command “scp” is nolonger possible

[Chapter&nbsp;10.&nbsp;Deprecated functionality Red Hat Enterprise Linux 9 | Red Hat Customer Portal](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/9.4_release_notes/deprecated-functionality#deprecated-functionality-security) says _“deprecated”_, not removed.

[https://access.redhat.com/documentation/en-us/red\_hat\_enterprise\_linux/9/html/9.4\_release\_notes/known-issues#known-issues-security](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/9.4_release_notes/known-issues#known-issues-security) tells that some scp syntax can wipe a file (when it should be a no-op).

* * *

Personally, I’d recommend `rsync`. It is versatile and does use ssh for transfer.

---

<div class="post-metadata">

**Author:** ![gerry666uk](https://avatars.discourse-cdn.com/v4/letter/g/dbc845/32.png) [@gerry666uk](https://forums.rockylinux.org/u/gerry666uk)\
**Post date:** [May 13, 2024, 6:45pm UTC](https://forums.rockylinux.org/t/sftp-file-transfer-protocol/14022/4 "2024-05-13T18:45:52Z")

</div>

The deprecated notice has been around for a while, but scp still seems to work. If scp really is using the sftp protcol behind the scenes, I wonder why they say it’s deprecated.

sftp is good for developers who want to upload huge complicated websites, e.g. from Windows/Mac.

rsync is good for synchronising huge directory structures, and making backups.

scp is handy when you want to quickly copy a single file.

---

<div class="post-metadata">

**Author:** ![jlehtone](https://avatars.discourse-cdn.com/v4/letter/j/e9a140/32.png) [@jlehtone](https://forums.rockylinux.org/u/jlehtone)\
**Post date:** [May 13, 2024, 7:21pm UTC](https://forums.rockylinux.org/t/sftp-file-transfer-protocol/14022/5 "2024-05-13T19:21:39Z")

</div>

> [@gerry666uk](#):
>
> scp is handy when you want to quickly copy a single file.

I don’t see it easier than:

```auto
rsync -av <folder_with_data_to_transfer>/<some_file> user@machine:<path_to_destination>

```

---

<div class="post-metadata">

**Author:** ![jbkt23](https://avatars.discourse-cdn.com/v4/letter/j/9fc29f/32.png) [@jbkt23](https://forums.rockylinux.org/u/jbkt23)\
**Post date:** [May 13, 2024, 10:09pm UTC](https://forums.rockylinux.org/t/sftp-file-transfer-protocol/14022/6 "2024-05-13T22:09:23Z")

</div>

I’ve used rsync to transfer files between machines I just don’t know that it is any more secure than scp.

---

<div class="post-metadata">

**Author:** ![iwalker](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/iwalker/32/2599_2.png) [@iwalker](https://forums.rockylinux.org/u/iwalker)\
**Post date:** [May 14, 2024, 8:22am UTC](https://forums.rockylinux.org/t/sftp-file-transfer-protocol/14022/7 "2024-05-14T08:22:39Z")

</div>

If you use the command like @jlehtone posted, it’s rsync over ssh. So it’s just as secure as scp/sftp. Now if you do rsync over rsyncd with port 873, then that is a different matter entirely.

---

<div class="post-metadata">

**Author:** ![jlehtone](https://avatars.discourse-cdn.com/v4/letter/j/e9a140/32.png) [@jlehtone](https://forums.rockylinux.org/u/jlehtone)\
**Post date:** [May 14, 2024, 9:02am UTC](https://forums.rockylinux.org/t/sftp-file-transfer-protocol/14022/8 "2024-05-14T09:02:54Z")

</div>

**man scp** writes:

> CAVEATS  
> The original scp protocol (selected by the `-O` flag) requires execution of the remote user’s shell to perform glob(3) pattern matching. This requires careful quoting of any characters that have special meaning to the remote shell, such as quote characters.

That relates to [1666127 – (CVE-2019-6111) CVE-2019-6111 openssh: Improper validation of object names allows malicious server to overwrite files via scp client](https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2019-6111)

In other words, a command like `scp foo:dir/*.txt ~` used to depend on shell of the remote machine to handle the glob, and “inventive” shell could expand that to: `scp foo:dir/.bashrc ~`  
The sftp protocol supposedly does not use remote shell.

Then again, one can run `rsync foo:dir/*.txt ~` too and a quick browse on the oh-so-short `man rsync` did not tell who does expand the `dir/*.txt` … _probably the remove shell_.

* * *

(If you cannot trust a system that you can ssh to … would any file transfer protocol be any safer?)

---

<div class="post-metadata">

**Author:** ![gerry666uk](https://avatars.discourse-cdn.com/v4/letter/g/dbc845/32.png) [@gerry666uk](https://forums.rockylinux.org/u/gerry666uk)\
**Post date:** [May 14, 2024, 6:33pm UTC](https://forums.rockylinux.org/t/sftp-file-transfer-protocol/14022/9 "2024-05-14T18:33:38Z")

</div>

But then you have to remember if you’re pulling or pushing, whether you need a trailling slash, and one tiny typing mistake, you could end up syncronising gigabytes of data.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/rockylinux/original/1X/91b7219eec10e30013422e4df76c1d898711a5d5.svg) [@system](https://forums.rockylinux.org/u/system)\
**Post date:** [July 13, 2024, 6:34pm UTC](https://forums.rockylinux.org/t/sftp-file-transfer-protocol/14022/10 "2024-07-13T18:34:03Z")

</div>

Closed on July 13, 2024, 6:34pm UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
