I’m trying to upload a file to an SFTP server for the first time and I’m not sure what steps or tools I should be using. I have the server address, username, and password, but I keep running into connection or permission errors whenever I try to transfer files. Can someone walk me through the correct way to upload files to an SFTP server and point out common mistakes to avoid?
Method 1: Using Terminal on macOS
If you want the no-frills, zero-GUI route, the built-in Terminal works fine for SFTP.
-
Open Terminal on your Mac.
- Path:
Applications > Utilities > Terminal - Or hit
Command + Space, typeTerminal, and press Enter.
- Path:
-
In the Terminal window, type:
sftp username@hostname- Replace
usernamewith your actual SFTP login name. - Replace
hostnamewith the server’s domain or IP, likeexample.comor192.168.1.10.
- Replace
-
Press Enter. When it asks for a password, type your SFTP password and hit Enter again.
- If the credentials are correct, you will end up at an
sftp>prompt.
- If the credentials are correct, you will end up at an
-
Basic commands that actually matter:
- Upload a file from your Mac to the server:
put /local/path/to/file.txt /remote/path/file.txt - Download a file from the server to your Mac:
get /remote/path/file.txt /local/path/file.txt - List files on the server:
ls - Change directory on the server:
cd /some/remote/folder - Change directory on your Mac (local side):
lcd /some/local/folder
- Upload a file from your Mac to the server:
Once you get used to it, it is fast, scriptable, and doesn’t need any extra apps. The downside is you have to be careful with paths and filenames because there is no visual feedback like a file browser.
Method 2: Using Commander One
If you like the old-school dual-pane file managers (think “two folders facing each other”), Commander One is very much that, but for macOS and with SFTP support built in.
-
Install Commander One from the Mac App Store:
https://apps.apple.com/us/app/commander-one-file-manager/id1035236694?mt=12 -
Open Commander One after it installs.
-
At the top menu, go to Connections.
-
Click Add connection, then choose SFTP as the connection type.
-
Fill in the SFTP details:
- Server address (domain or IP)
- Username
- Password
Optionally, you can tweak port, default remote directory, etc., if your host requires that.
-
Save and connect. Once it logs in successfully, one of the panels will show the remote server, and the other panel will usually show a local folder.
-
Now you can:
- Drag files from your Mac panel to the server panel to upload.
- Drag from the server panel back to your Mac to download.
- Rename, move, or delete files with right-click or shortcuts, same as a normal file manager.
This setup is nice if you do a lot of back-and-forth transfers and want something more visual than Terminal, but still fairly “power user” friendly.
Method 3: Using Cyberduck
Cyberduck is one of those simple-but-capable tools that a lot of people end up keeping installed forever just for SFTP and other remote file protocols.
-
Download and install Cyberduck from its official site or the Mac App Store.
-
Launch Cyberduck.
-
Click the Open Connection button in the toolbar.
-
In the connection window:
- From the dropdown at the top, pick SFTP (SSH File Transfer Protocol).
- In the Server field, enter the hostname or IP of your SFTP server.
- Enter your Username and Password in the corresponding fields.
- Change the Port if your provider uses something other than 22.
-
Click Connect.
- The first time you connect, it might ask you to confirm the server’s fingerprint. Accept it if it matches what your host gave you.
-
Once connected, Cyberduck shows a remote file list. You can:
- Drag files from Finder into Cyberduck to upload.
- Drag files from Cyberduck to Finder to download.
- Right-click for rename, delete, and permission changes.
Cyberduck behaves like a regular file browser but runs on top of SFTP, so it is a good fit for anyone who does not want to memorize terminal commands and just wants “click, drag, done.”
If you already tried what @mikeappsreviewer suggested and you’re still getting connection or permission errors, the problem is probably not “which app” but one of these:
-
Wrong protocol / port
- Make sure the host actually supports SFTP, not plain FTP or FTPS.
- Ask whoever gave you the creds:
- “Is this SFTP over SSH on port 22?”
- If they say port 22 is closed and they’re using some custom port (like 2222), you have to set that in whatever tool:
- In GUI tools, there’s a “Port” field.
- In CLI:
sftp -P 2222 username@hostname
-
Firewall / VPN issues
- On some corporate networks, outbound SSH/SFTP is blocked.
- Quick test: from a terminal run:
If that hangs or times out, it’s probably firewall, not your password.ssh username@hostname - Try:
- Different Wi‑Fi / mobile hotspot
- Temporarily disconnect VPN, or sometimes use VPN if they require it
-
You’re on the server but can’t upload (permissions)
If you can connect and see files, but uploads fail with something like:Permission deniedFailed to open ...
then:- You are in a directory you don’t have write access to.
- In any client, check the remote path you’re in. Often you need to upload to a specific folder like
/incoming,/upload, or/home/youruser. - On the server, run:
If you see something like:pwd ls -ldrwxr-xr-xand your user is not the owner, or there’s nowfor you, you can’t write there.
- Ask the admin:
- “What exact remote folder should I upload to?”
- “Does my account have write permissions there?”
-
Home dir chroot / jail
Some SFTP setups “jail” you into a specific directory and you’re only allowed there. If you try to jump elsewhere via/some/path, it fails.- In that case, log in and stay in the initial directory or use only subdirectories of it.
- If your instructions say “upload to
/var/www/html” but your jailed account can’t reach it, that’s on whoever set the server up. You can’t fix that client-side.
-
Password vs key authentication
It sounds like you have a password, but sometimes the server is actually set to key-only auth (or password + key).- Symptom: it keeps saying
Permission denied (publickey,password)even though password is right. - You’d need to:
- Generate an SSH keypair.
- Send your public key to the admin to add to
authorized_keys.
- Most GUI clients (including Commander One) let you pick a private key file in connection settings.
- Symptom: it keeps saying
-
Try a different client to isolate the issue
I slightly disagree with relying only on command line like @mikeappsreviewer suggests. It’s useful, but for a first-time setup, a visual tool makes it easier to spot “oh, I’m in the wrong folder.”Since you’re on macOS, I’d go with Commander One as a next step:
- Its dual-pane layout makes it obvious which side is local vs remote.
- After you configure the SFTP connection, focus on:
- Confirming you’re in the correct remote directory (shown at the top path bar).
- Drag a tiny test file (like a text file) from local to remote.
- If that fails, check the exact error string:
- If it says
Permission denied→ permissions / folder problem. - If it says
Connection refusedorTimed out→ firewall / wrong host or port. - If it says
Authentication failed→ wrong password / wrong auth method.
- If it says
-
Checklist to methodically debug
Run through this order:- Can you ping the hostname?
ping hostname - Can you reach SFTP port?
or with custom port:nc -vz hostname 22nc -vz hostname 2222 - Can you at least SSH?
ssh username@hostname - Once connected, do you see any directory you can write to?
- Try uploading a small file there via Commander One.
- If none of that works, send the server admin:
- The exact error message
- The port and protocol you’re using
- Whether you can connect from any network
- Can you ping the hostname?
Most of the time, “keeps running into connection or permission issues” comes down to someone on the server side not telling you the correct port or upload directory. You can try every app on earth and it won’t fix a read-only folder or blocked port.
If you post the exact error text you see (copy/paste), people can usually point out the precise problem in one or two replies instead of you guessing in the dark.
Couple of things to add on top of what @mikeappsreviewer and @reveurdenuit already laid out, since you’re still getting blocked.
First, stop changing tools every 5 minutes. If you switch between Terminal, Cyberduck, and three other apps, all you’re doing is re-creating the same error in different colors. Pick one method, get it working, then worry about “nice” tooling.
Given you’re new to SFTP, I’d actually stick with a GUI for now, not raw sftp in Terminal. Yeah, CLI is powerful, but it’s also a great way to be confused by paths and silent failures. A good middle ground is a dual‑pane client like Commander One:
- Left pane: your Mac (local)
- Right pane: SFTP server (remote)
- Drag left → right to upload, right → left to download
It’s easier to visually confirm “oh, I’m actually in /home/myuser/incoming” instead of guessing in Terminal.
Now, about the actual problems you’re describing (connection / permission):
1. Confirm the exact protocol and port
Everyone keeps saying this, but this is where most people mess up.
Don’t assume:
- If your host docs say FTP or FTPS, that is not SFTP.
- SFTP is over SSH, usually on port
22, but can be anything like2222or8022.
Ask whoever gave you the details:
“Is this SFTP over SSH? What port should I use?”
If they say something like “FTP over TLS, port 21” then none of the SFTP stuff will work no matter what client you use.
2. Make sure you’re even reaching the server
On macOS Terminal:
nc -vz hostname 22
Replace 22 with whatever port they told you.
- If you get
succeeded→ network path is open. - If it hangs or says
Operation timed outorConnection refused→ this is a firewall / wrong host / wrong port issue, nothing to do with permissions.
If nc fails, stop. Don’t keep retrying passwords in Cyberduck or Commander One. Fix network / port first, or try from a different network (hotspot, home vs office, etc).
3. Diagnose the kind of error, not just “it doesn’t work”
When you try to connect or upload, read the exact error:
-
Authentication failedorPermission denied (publickey,password)
→ wrong password, wrong username, or server expects an SSH key instead of just a password. -
Connection refused
→ wrong port or SFTP service not running there. -
Operation timed out
→ firewall / blocked port / bad hostname. -
Permission deniedonly when uploading a file
→ credentials are fine, but you’re in a directory you can’t write to.
This is where a GUI like Commander One helps because it will usually show a clearer message and you can see what remote folder you’re in.
4. Typical “I’m connected but can’t upload” situation
This one bites a lot of first-timers.
You log in fine, you can see files, but when you upload, you get Permission denied.
That almost always means:
- You’re in a read-only directory by default, or
- The admin wants you to use a special upload folder like
/incoming,/uploads, or/home/youruser.
In Commander One, chec the path bar on the remote side. If they told you “upload to /incoming” but you see / or /var/www at the top, change into the right folder first, then drag a tiny test file. If that fails, copy the exact error and send it to the admin.
5. Password vs SSH key confusion
You said you have a username and password, but some servers are configured as:
- key‑only (no passwords), or
- key + password (2 factors)
If your client keeps saying something like:
Permission denied (publickey,password)
even though your password is 100% right, they probably never enabled password auth for your account. In that case you need to:
- Generate an SSH keypair on your Mac:
ssh-keygen -t ed25519 - Give the public key (
~/.ssh/id_ed25519.pub) to the server admin. - In Commander One (or Cyberduck), configure it to use your private key (
id_ed25519) for SFTP.
This is not something you can “fix” client-side if the server says “I only accept keys.”
6. How I’d methodically do this from scratch
If I were at your machine, I’d do:
- Confirm host, protocol, and port with whoever gave you the info. Explicitly ask: “SFTP, port X, right?”
- In Terminal:
nc -vz hostname PORT - If that works, open Commander One:
- New SFTP connection
- Set hostname, username, password
- Set port correctly
- Connect and check:
- What folder does it drop me into on the remote side?
- Can I drag a 1 KB text file into that folder?
- If upload fails, copy the exact error and send it to the admin with:
- screenshot of the remote path
- message: “This is the folder I land in. Is this where I’m supposed to upload, and does my user have write access here?”
You’ll get farther with one clear screenshot + error message than by trying six different apps.
TL;DR: Use something visual like Commander One until you’ve verified port, protocol, and upload folder. Your issue is almost certainly not “wrong app,” it’s “wrong port” or “wrong directory / insufficient permissions,” and no tool can magically fix that.