未找到 ssh-copy-id sh 命令

未找到 ssh-copy-id sh 命令

我正在尝试将我的 ssh 密钥复制到我的机器上,但每次运行时 ssh-copy-id archie@localhost 都会出现以下错误:

/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/archie/.ssh/id_rsa.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
archie@localhost's password: 
zsh:1: command not found: sh

在示例中它是本地主机,但是当我尝试使用另一台机器时,它出现相同的错误。

答案1

sh指的是/bin/sh,根据发行版的不同,通常是指向/bin/bash或 的符号链接/bin/dash。尝试在终端中运行该命令sh,如果返回错误,则表示/bin/sh不存在。如果您有权root访问系统,则可以通过运行 来修复此问题ln -s /bin/bash /bin/sh

相关内容