問題描述:
- 在Linux上新建了一個用戶
useradd -aG wheel someone
- 在
/home/someone
中新建.ssh/authorized_keys
‘ - 將本地 id_rsa.pub 文件copy到遠(yuǎn)程主機叹阔;看著這個log就有種不祥的預(yù)感
/ # ssh-copy-id jduc@101.124.7.232 /usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.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 expr: warning: '^ERROR: ': using '^' as the first character of a basic regular expression is not portable; it is ignored /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 jduc@101.124.7.232's password:
- ssh 登錄; 果然,ops
λ ssh someone@x.x.x.x someone@x.x.x.x's password:
解法
- 當(dāng)然是Google嘍痒留, 原因是權(quán)限問題: .ssh 文件的權(quán)限需要時700, authorized_keys 權(quán)限是 600
chmod 700 ~/.ssh chmod 600 ~/.ssh/authorized_keys
- 本地ssh 重新登錄堂飞; perfect~
λ ssh someone@x.x.x.x Last login: Mon Jul 2 14:16:46 2018 from 111.200.23.14 Welcome to xxx Service [someone@FrontendProd ~]$
next
- 為什么是權(quán)限問題力图?