Linux下设置SSH通过密钥登录

所需积分/C币:14 2017-05-31 09:31:28 2.56MB PDF

我们一般使用PuTTY等SSH客户端来远程管理 Linux 服务器。但是,一般的密码方式登录,容易有密码被 暴力破解的问题。所以,一般我们会将 SSH 的端口设置为默认的 22 以外的端口,或者禁用 root 账户登 录。其实,有一个更好的办法来保证安全,而且让你可以放心地用 root 账户从远程登录——那就是通过 密钥方式登录。 密钥形式 登录的原理是:利用密钥生成器制作一对密钥;(公钥文件和私钥文件)。将公钥添加到服务器的 某个账户上,然后在客户端利用私钥即可完成认证并登录。这样一 来,没有私钥,任何人都无法通过 SSH 暴力破解你的密码来远程登录到系统。此外,如果将公钥复制到其他账户甚至
User keys Name Type Length Import. id rsa 3072 RSA 3072bt Export Delete Rename Properti Generate Close ssh-rsa AAAAB3Nzaclyc2EAAAABIWAAAYEAurVVNj83hyFyBuqAOL8Bp8EKR+P7EMu4x T2qxbUHS1ZG+q229eVnzhGEi/qrxwy5C71ID7NLaK445RG4cci63rYcGLhk/GCWiAkoo4 wiwt+R6jA9RdPrsqs koRILYCIkjwxcvgYs/z9WL4dg2YQGVNw96GfyUzWOLYr4CpaImBb 5gTxINUeDjmsaufv/IwjUgso3QRqm3KgtgscJisifl8xmhcwcwBEfaam9K2y6ZyG+7vB8 tdtMSMPwn+7dkLHyrunxgs1J79IUXZSMMK/QWCzvucskvGL5q/CK5zGlICC6TIN/JI/WG rfc6nNXUleHqIW9cQho44Tjmr pYd2ka2L51puy6tHSTU5ePJzmbr2L-+YtoaAjKXB7MOSE JraGJj8Bakwohhzdwsx 3UBbjNoQnbB/yTo7ZM8XQLhPblnxoeavZEpMp PasswordAuthentication no ChallengeResponseAuthentication no [root(localhost -t service sshd restart 停止sshd [确定 启动sshd: [确定 [rootalocalhost -14 SSH User futhent icat ion Remote host:192168.0.105:22 root Server Type: SSH2, OpenssH 4.3 Select a proper user authentication method among the methods below and provide necessary information to log in. Password Password O Public Key User Key: id_rsa_3072 Browse.t Passphrase:·争 Keyboard Interactive Use keyboard input for user authentication □ Remember password K Cance root@localhost -]tssh-keygen -b 2048 Generating public/private rsa key pair Enter file in which to save the key (/root/, ssh/id rsa): Created directory "/root/. ssh' Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /root/, ssh/id rsa Your public key has been saved in /root/ssh/id rsa, pub The key fingerprint is: 4d: 96: 45: 88: 8b: 3d: 30: 3f:e7: 64: 9a: 62: e3: 0e: fa: 27 rootelocalhost local root@localhost If [rootelocalhost -]t cd -/. ssh/ root(localhost.ssh]t Is d rsa id rsa. pub [rootelocalhost shiT rootelocalhost ssh]* mv id rsa pub authorized keys [root(localhost sshI# 1s authorized keys id rsa [root(localhost ssh)t PasswordAuthentication no ChallengeResponseAuthentication no root@localhost -]t service sshd restart 止sshd [确定 启动shd: 确定 root(localhost-]#■ FileEdit View ToolsWindowHelp ③国 Sun Shor t- cut key 2 1 Local Shel A Most Key Me at园 localhost ss 岛 User Key Manager oot@localhost ss1 User Key Generation Wizard ootelocalhost s3 止33hd 2 Launch agent Launch activator oot园1aca1h。tss Color schi nnection closed a Quick Command Sets pe help"t。1ea he11:> shell 4 File Edit View Tools Window Help se", nE rEconnect,的Qg,, ●1 Loca She11x User i T Length Im 1 Delete Rename Propert Generate Close U ? Name Type Length Import. Delet Rename Propertie Passphrase Enter a passphrase to import the selected user key User key id rs Passphrase:·●·· oK Cancel SSH User uthentication Remote Host:1921680.105:22 Login Name: root Server Type: SSH2, Opens5H43 Select a proper user authentication method among the methods below and provide necessary information to log in. Password ⊙ Public Key User Key: id_rsa Browse. t Passphrase:·香香 Keyboard Interactive Use keyboard input For user authentication member password OK Cancel Connection closed Type help' to learn how to use shell prompt. shell:\> Connection closed by foreign host shell:\> Connecting to 192.168.0.105: 22 Connection established To escape to local shell, press 'ctrl+Alt+ ast1ogin: Sat Jun2304:09:102012from192.168.0.103 [rootelocalhost If

...展开详情
试读 8P Linux下设置SSH通过密钥登录
img

关注 私信 TA的资源

上传资源赚积分,得勋章
    最新推荐
    Linux下设置SSH通过密钥登录 14积分/C币 立即下载
    1/8
    Linux下设置SSH通过密钥登录第1页
    Linux下设置SSH通过密钥登录第2页
    Linux下设置SSH通过密钥登录第3页

    试读已结束,剩余5页未读...

    14积分/C币 立即下载 >