日韩黑丝制服一区视频播放|日韩欧美人妻丝袜视频在线观看|九九影院一级蜜桃|亚洲中文在线导航|青草草视频在线观看|婷婷五月色伊人网站|日本一区二区在线|国产AV一二三四区毛片|正在播放久草视频|亚洲色图精品一区

分享

移植ssh到arm

 mrjbydd 2013-08-06
1. 下載需要的源碼:
    mkdir -p ~/arm/fs ;mkdir -p ~/arm/source
    下載zlib: wget -c http://www./zlib-1.2.3.tar.gz
    下載ssl: wget -c http://www./source/openssl-0.9.8d.tar.gz
    下載ssh: wget -c http://mirror.mcs./openssh/portable/openssh-4.6p1.tar.gz


2. 編譯:
    cd ~/arm/source

    (1) 編譯zlib:
     tar zxvf zlib-1.2.3.tar.gz -C .
     cd zlib-1.2.3/
     ./configure --prefix=/home/david/fs/zlib-1.2.3
    修改Makefile:
       CC=gcc 改為:
       CROSS=arm-linux-
   CC=$(CROSS)gcc
       LDSHARED=gcc 改為: LDSHARED=$(CROSS)gcc
       CPP=gcc -E   改為: CPP=$(CROSS)gcc -E
       AR=ar rc     改為: AR=$(CROSS)ar rc
開始編譯: make;
           make install

   (2) 編譯openssl:
       tar zxvf openssl-0.9.8d.tar.gz
    ./Configure --prefix=/home/david/fs/openssl-0.9.8d os/compiler:arm-linux-gcc
    make
    make install

   (3) 編譯openssh:
    tar zxvf openssh-4.6p1.tar.gz
    cd openssh-4.6p1/
    ./configure --host=arm-linux --with-libs --with-zlib=/home/linksens/tools/fs/zlib-1.2.3
         --with-ssl-dir=/home/david/fs/openssl-0.9.8d --disable-etc-default-login    
         CC=arm-linux-gcc AR=arm-linux-ar
      make
    ##不要make install


3. 安裝
    
    (1) 將 openssh-4.6p1目錄下的 sshd 拷貝到 目標(biāo)板的/usr/sbin目錄下
    (2) 再copy scp   sftp  ssh   ssh-add   ssh-agent   ssh-keygen   ssh-keyscan 到目標(biāo)板/usr/local/bin目錄下
          copy 
sftp-server   ssh-keysign    到/usr/local/libexec
       
    (3) 在目標(biāo)板下:

        mkdir -p /usr/local/etc/ 
        然后將openssh下的sshd_config,ssh_config 拷貝到該目錄下

        mkdir -p /var/run; mkdir -p /var/empty/sshd 
        chmod 755 /var/empty     
    (4)在主機(jī)上:
                  ssh-keygen -t rsa1 -f ssh_host_key -N ""
     
    ssh-keygen -t rsa -f ssh_host_rsa_key -N ""
         
ssh-keygen -t dsa -f ssh_host_dsa_key -N ""
        將生存的 ssh_host_* 4個(gè)文件copy到目標(biāo)板的 /usr/local/etc/目錄下
     (5) 添加用戶:
    將主機(jī)上 /etc/目下的 passwd, shadow, group 三個(gè)文件copy到目標(biāo)板的 /etc目錄下, 同時(shí)記得將passwd的最后 /bin/bash 該為 /bin/sh 
    其實(shí)可以刪除不需要的一些用戶。
     
4.測(cè)試
   目標(biāo)板啟動(dòng)sshd: # /usr/sbin/sshd
     主機(jī): $ ssh root@192.168.237.239

ps: 紅色的那些代表讓arm做ssh server時(shí)必須的

以上參考:http://hi.baidu.com/fcni_cn/blog/item/4a3ee7115e08cd18b8127b4f.html


遇到問題:
1 Permissions 0644 for '/usr/local/etc/ssh_host_key' are too open
此為文件的權(quán)限問題,解決方法為:

# cd /usr/local/etc

# ls

moduli ssh_host_dsa_key ssh_host_key ssh_host_rsa_key sshd_config

ssh_config ssh_host_dsa_key.pub ssh_host_key.pub ssh_host_rsa_key.pub

# ls -l

total 194

-rwxr-xr-x 1 bin bin 88039 Nov 21 2002 moduli

-rwxr-xr-x 1 bin bin 1144 Nov 21 2002 ssh_config

-rwxr-xr-x 1 root other 672 Dec 19 13:55 ssh_host_dsa_key

-rwxr-xr-x 1 root other 600 Dec 19 13:55 ssh_host_dsa_key.pub

-rwxr-xr-x 1 root other 525 Dec 19 13:54 ssh_host_key

-rwxr-xr-x 1 root other 329 Dec 19 13:54 ssh_host_key.pub

-rwxr-xr-x 1 root other 887 Dec 19 13:55 ssh_host_rsa_key

-rwxr-xr-x 1 root other 220 Dec 19 13:55 ssh_host_rsa_key.pub

-rwxr-xr-x 1 bin bin 2470 Nov 21 2002 sshd_config

# chmod 0644 *

# ls -l

total 194

-rw-r--r-- 1 bin bin 88039 Nov 21 2002 moduli

-rw-r--r-- 1 bin bin 1144 Nov 21 2002 ssh_config

-rw-r--r-- 1 root other 672 Dec 19 13:55 ssh_host_dsa_key

-rw-r--r-- 1 root other 600 Dec 19 13:55 ssh_host_dsa_key.pub

-rw-r--r-- 1 root other 525 Dec 19 13:54 ssh_host_key

-rw-r--r-- 1 root other 329 Dec 19 13:54 ssh_host_key.pub

-rw-r--r-- 1 root other 887 Dec 19 13:55 ssh_host_rsa_key

-rw-r--r-- 1 root other 220 Dec 19 13:55 ssh_host_rsa_key.pub

-rw-r--r-- 1 bin bin 2470 Nov 21 2002 sshd_config

# chmod 0600 ssh_host_dsa_key ssh_host_key ssh_host_rsa_key

# ls -l

total 194

-rw-r--r-- 1 bin bin 88039 Nov 21 2002 moduli

-rw-r--r-- 1 bin bin 1144 Nov 21 2002 ssh_config

-rw------- 1 root other 672 Dec 19 13:55 ssh_host_dsa_key

-rw-r--r-- 1 root other 600 Dec 19 13:55 ssh_host_dsa_key.pub

-rw------- 1 root other 525 Dec 19 13:54 ssh_host_key

-rw-r--r-- 1 root other 329 Dec 19 13:54 ssh_host_key.pub

-rw------- 1 root other 887 Dec 19 13:55 ssh_host_rsa_key

-rw-r--r-- 1 root other 220 Dec 19 13:55 ssh_host_rsa_key.pub

-rw-r--r-- 1 bin bin 2470 Nov 21 2002 sshd_config

2 在ssh目標(biāo)機(jī)時(shí)出現(xiàn)

ssh root@192.168.237.239

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!

Someone could be eavesdropping on you right now (man-in-the-middle attack)!

It is also possible that the RSA host key has just been changed.

The fingerprint for the RSA key sent by the remote host is

97:ff:ec:78:48:69:c0:61:1d:82:9b:6c:2e:6b:6b:46.

Please contact your system administrator.

Add correct host key in /root/.ssh/known_hosts to get rid of this message.

Offending key in /root/.ssh/known_hosts:11

RSA host key for 192.168.237.239 has changed and you have requested strict checking.

Host key verification failed.

警告中已經(jīng)說

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購(gòu)買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類似文章 更多