Description
I first encountered this problem when I tried to use SCP to another computer over LAN, and get
zsh:1: command not found: scp
Now before anyone asks: yes I have SSH installed.
I can use ssh to log into the other computer just fine.
The problem is SCP, and ssh [user@]hostname [command]
both result in zsh:1: command not found: [command]
.
Testing
I tried using SCP with localhost
systemctl start sshd.service
scp /home/user/asdf.log [email protected]:/home/user/test/asdf.log
...
zsh:1: command not found: scp
And then sending a command:
ssh [email protected] ls
...
zsh:1: command not found: ls
ssh [email protected]
works as expected.
I used the -v
switch, and the info looked normal.
I tried switching to Bash instead of ZSH; same error.
Finally, I tried root login, and that worked
ssh [email protected] ls
...
Desktop
Documents
Music
...
SSH Config:
~/.ssh/config
: nothing
#/etc/ssh/sshd_config
PermitRootLogin yes # this is bad; for testing only
AuthorizedKeysFile .ssh/authorized_keys
ChallengeResponseAuthentication no
UsePAM yes
PrintMotd no #pam does that
Subsystem sftp /usr/lib/ssh/sftp-server
Using Arch Linux with openssh 7.9p1
TL;DR
It looks like the environment isn't getting set (not even PATH)
for SCP and single command SSH. But, for root login it is getting set properly.
Any ideas about this?
Update
It's something with my user shell config.
I added a new, blank user account, and using SCP into that worked fine.