久久青草精品A片狠狠,日韩欧美视频一区二区,亚洲国码AV日韩,国产精品黄在

CentOS 配置無(wú)密碼登錄的實(shí)現(xiàn)

2019-07-10 10:29:55 7918

配置sshd服務(wù) 在服務(wù)器上修改/etc/ssh/sshd_config:

<!-- lang: shell -->


#禁止root登錄

PermitRootLogin no


#指定可以登錄的用戶

AllowUsers bob alice

StrictModes yes


#關(guān)閉密碼驗(yàn)證

PasswordAuthentication no


#打開(kāi)RSA驗(yàn)證相關(guān)設(shè)置

RSAAuthentication yes

PubkeyAuthentication yes


AuthorizedKeysFile   .ssh/authorized_keys


#關(guān)閉 GSSAPI驗(yàn)證

GSSAPIAuthentication no


重啟sshd服務(wù)


生成rsa-keypair 切換到允許ssh登錄的用戶賬戶執(zhí)行如下執(zhí)行如下命令:

<!-- lang: shell -->


#生成key-pair

ssh-keygen 

cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys

sudo chmod 600 ~/.ssh/authorized_keys

sudo chmod 700 ~/.ssh

restorecon -R -v ~/.ssh

復(fù)制剛剛生成的id_rsa文件到本地,一般命名為:server.pem


ssh -i server.pem username@server


提交成功!非常感謝您的反饋,我們會(huì)繼續(xù)努力做到更好!

這條文檔是否有幫助解決問(wèn)題?

非常抱歉未能幫助到您。為了給您提供更好的服務(wù),我們很需要您進(jìn)一步的反饋信息:

在文檔使用中是否遇到以下問(wèn)題: