Chinaunix首页 | 论坛 | 博客
  • 博客访问: 462923
  • 博文数量: 132
  • 博客积分: 2995
  • 博客等级: 少校
  • 技术积分: 1412
  • 用 户 组: 普通用户
  • 注册时间: 2007-03-06 20:14
文章分类

全部博文(132)

文章存档

2010年(2)

2008年(21)

2007年(109)

我的朋友

分类:

2007-03-07 14:39:33

  • RAS/DSA认证安装过程(
    [root@domain ~]$su - tenten
    [tenten@domain ~]ssh-keygen -t rsa
    Generating public/private rsa key pair.
    Enter file in which to save the key (/home/tenten/.ssh/id_rsa):[Enter]
    Enter passphrase (empty for no passphrase):
    Enter same passphrase again:
    Your identification has been saved in /home/tenten/.ssh/id_rsa.
    Your public key has been saved in /home/tenten/.ssh/id_rsa.pub.
    The key fingerprint is:
    c7:93:83:c4:24:30:56:90:37:a0:eb:a7:5d:4c:8d:ea:1a: tenten@example.com

    :::或者:::

    [tenten@kdx ~]$ ssh-keygen -t dsa
    Generating public/private dsa key pair.
    Enter file in which to save the key (/home/tenten/.ssh/id_dsa):
    Enter passphrase (empty for no passphrase):
    Enter same passphrase again:
    Your identification has been saved in /home/tenten/.ssh/id_dsa.
    Your public key has been saved in /home/tenten/.ssh/id_dsa.pub.
    The key fingerprint is:
    a2:be:16:2e:66:e4:69:68:a0:eb:a7:5d:4c:8d:ea:1a:da:54:35:55:32:8e:e2 tenten@example.com

    查看生成的文件:
    [tenten@kdx ~]$ ls /home/tenten/.ssh/ -la
    total 28
    drwx------ 2 tenten tenten 4096 Oct 11 16:09 .
    drwx------ 3 tenten tenten 4096 Oct 9 16:50 ..
    -rw------- 1 tenten tenten 736 Oct 11 16:09 id_dsa
    -rw-r--r-- 1 tenten tenten 612 Oct 11 16:09 id_dsa.pub
    -rw------- 1 tenten tenten 951 Oct 11 16:03 id_rsa
    -rw-r--r-- 1 tenten tenten 232 Oct 11 16:03 id_rsa.pub
    -rw-r--r-- 1 tenten tenten 667 Oct 9 16:48 known_hosts
    设置 sshd_config 文件,去除密码认证
    # To disable tunneled clear text passwords, change to no here!
    PasswordAuthentication no
    由于在 sshd_config 文件里面,我们设置了以下内容:
    #AuthorizedKeysFile .ssh/authorized_keys
    所以我们要把共匙重命名为 autherized_keys
    [root@domain .ssh]# mv id_dsa.pub autherized_keys
    所以最终服务器端 ~/.ssh/ 目录下的内容为(注意authorized_keys的权限为 644)
    [tenten@domain .ssh]$ ls -la
    total 12
    drwx------ 2 tenten tenten 4096 Oct 11 19:57 .
    drwx------ 3 tenten tenten 4096 Oct 11 18:50 ..
    -rw-r--r-- 1 tenten tenten 232 Oct 11 19:46 authorized_keys

  • 引申:
    在安装 openssh 的最后,输入 make install 命令后,会发现最后会生成 public/private key:
    Generating public/private rsa1 key pair.
    Your identification has been saved in /usr/local/etc/ssh_host_key.
    Your public key has been saved in /usr/local/etc/ssh_host_key.pub.
    The key fingerprint is:
    22:67:00:5f:82:87:ab:22:e7:8e:cd:bb:d2:07:98:57 root@example.com

    Generating public/private dsa key pair.
    Your identification has been saved in /usr/local/etc/ssh_host_dsa_key.
    Your public key has been saved in /usr/local/etc/ssh_host_dsa_key.pub.
    The key fingerprint is:
    17:6c:d8:6f:31:db:bd:3c:66:81:86:12:13:a4:33:a3 root@example.com

    Generating public/private rsa key pair.
    Your identification has been saved in /usr/local/etc/ssh_host_rsa_key.
    Your public key has been saved in /usr/local/etc/ssh_host_rsa_key.pub.
    The key fingerprint is:
    27:0e:16:41:f8:96:ed:93:b6:a8:61:74:fe:87:e2:91 root@example.com
    /usr/local/sbin/sshd -t -f /usr/local/etc/sshd_config

  • 阅读(1407) | 评论(0) | 转发(0) |
    0

    上一篇:FREEBSD IP 设置

    下一篇:solaris 上安装oracle

    给主人留下些什么吧!~~