The pre-installed sftp binary on macOS sucks. When I use my ubuntu machine, sftp has glorious things like a history and tab completion. I've looked around, and cannot tell a clear cut path to upgrading the binary. Has anyone done this? How?
2 Answers
Install homebrew a macOS package manager. https://brew.sh/
HomeBrew is most often mentioned these days. sftp appears to be one of the programs you can download.
other package managers are: MacPort -- BSD licenses Fink -- GNU General Public License
I'd figure out what sftp client Ubuntu uses and look around for the macOS version.
-
Can you specify the exact name of the formula for installing sftp using Homebrew?– Nimesh Neema ♦Commented May 13, 2019 at 3:54
-
Agreed with Nimesh. I don't see it on homebrew, I checked before asking the question.– justinCommented May 13, 2019 at 12:11
-
1
-
@justin openssh.com --> man.openbsd.org/sftp.1 Thanks for the assist da4 Commented May 13, 2019 at 18:56
tl;dr: openssh
homebrew package
Right now, if you which sftp
, you'll see /usr/bin/sftp
, which is Apple's crippled version of the program. You can install the latest vanilla OpenSSH (includes ssh
, sftp
, scp
, ssh-agent
, etc) to solve the problem.
Assuming you have Homebrew installed:
brew install openssh
Now it's installed. However, if you run which sftp
, you might still see the old /usr/bin/sftp
and not the Homebrew one installed at /usr/local/bin/sftp
. We don't want to overwrite Apple's files (generally not a good idea) so we'll just set the Homebrew binaries as a higher priority in your terminal.
Adjust your PATH in your .zshrc
:
export PATH=$(brew --prefix)/bin:$PATH
Open a new terminal and you'll probably see which sftp
return /usr/local/bin/sftp
. Done.