01 January 2026
pfsense
scp
ssh
networking
firewall
pfSense and SCP: Fix the 'Illegal option' Error
Quick one-liner: SCP to pfSense fails with "Illegal option -X"? Here's the one-line fix — use the root account instead of admin.
🤔 Why This Matters
When you try to copy a file to pfSense using scp as the admin user, you'll likely hit this error:
$ scp backup.xml admin@pfsense:/root/
Illegal option -X
lost connection
pfSense uses a restricted shell for the admin user that doesn't support the SCP protocol properly. The -X error comes from the scp client trying to negotiate an extended transfer mode that pfSense's admin shell doesn't understand.
🔧 The Fix
Use the root account instead:
scp backup.xml root@pfsense:/root/
The root account on pfSense runs a proper shell that fully supports SCP. No errors, no restricted commands, just works.
✅ Alternative: Use SFTP
If you don't want to enable root SSH access, use sftp instead — it works with the admin account:
sftp admin@pfsense
sftp> put backup.xml /root/