Port OpenSSH to ARM Platform-specifically to start the SSHD service

Source: Internet
Author: User

Port OpenSSH to ARM Platform -- specifically, start the SSHD service source code package www.2cto.com. Note: the tool chain used by the author is arm-none-linux-gnueabi-gcc (Sourcery G ++ Lite 2010.09-50) 4.5.1. Create an openssh directory on the host at www.2cto.com, store the downloaded source file package, and decompress it under the folder. # Mkdir-p openssh # tar-xz-f openssh-6.0p1.tar.gz -- unzip OpenSSH source package # tar-xz-f zlib-1.2.3.tar.gz -- unzip ZLIB source package # tar-xz-f openssl-1.0.1c.tar.gz -- decode OpenSSL source code create the install directory under the openssh directory, used to store generated files and installation directories. # Mkdir-p install cross-compilation steps ZLIB (1) Compile zlib # cd (full path name)/openssh/zlib-1.2.3 #. /configure -- prefix = (full path name)/openssh/install/zlib-1.2.3 modify Makefile under the zlib-1.2.3 Directory :? Add the following content in the first line: CROSS = arm-none-linux-gnueabi -? CC = gcc changed to: CC = $ (CROSS) gcc? LDSHARED = gcc changed to: LDSHARED = $ (CROSS) gcc? CPP = gcc-E to: CPP = $ (CROSS) gcc-E? AR = ar rc changed to: AR = $ (CROSS) ar rc # make install after compilation and installation, the compiled ZLIB library and header files are installed in the (full path name)/openssh/install/zlib-1.2.3 directory. OpenSSL # cd (full path name)/openssh/openssl-1.0.1c #. /Configure-prefix = (full path name)/openssh/install/openssl-1.0.1c OS/compiler: arm-none-linux-gnueabi-gcc # make install after compilation and installation, the compiled OpenSSL library and header files are installed in the (full path name)/openssh/install/openssl-1.0.1c directory. Www.2cto.com OpenSSH # cd (full path name)/openssh/openssh-6.0p1 #. /configure -- host = arm-linux -- with-libs -- without-pam -- with-zlib =/home/Archer/Desktop/openssh/install/zlib-1.2.3 -- with-ssl-dir = /home/Archer/Desktop/openssh/install/openssl-1.0.1c -- disable-etc-default-login CC = arm-none-linux-gnueabi-gcc AR = arm-none-linux-gnueabi -ar # make install now, openSSH compilation is complete. Deploy OpenSSH to the ARM board u and copy the sshd under the openssh-6.0p1 directory to the/usr/local/sbin directory of the target board; u copies scp, sftp, ssh, ssh-add, ssh-agent, ssh-keygen, ssh-keyscan, and ssh-rand-helper under the openssh-6.0p1 directory to/usr/ local/bin directory; u copies sftp-server and ssh-keysign under the openssh-6.0p1 directory to the/usr/local/libexec directory of the target board; u copies the sshd_config, ssh_config, and moduli under the openssh-6.0p1 directory to the/usr/local/etc directory of the target board; u creates the Directory and user required for SSHD work on the target board; www.2cto.com # mkdir/var/empty # chown root: root/v Ar/empty # chmod 755/var/empty # addgroup sshd # adduser-G sshd-g 'sshd privsep'-h/var/empty-s/bin/ssh sshdu on the target machine or on the host, generate Certificate/password equivalence. # 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 "" The generated six files, ssh_host_dsa_key, secret, ssh_host_key, ssh_host_key.pub, ssh_host_rsa_key, and secret, must be copied to the/usr/local/etc directory of the target board. Run u/usr/local/sbin/sshd to enable the SSH service. The author used the Busybox version 1.17.3. When you compile Busybox, do not select "Login/Password Management Utilities ---> [] Use internal password and group functions rather than system functions. U/etc/passwd. Pay special attention to this file. Because OpenSSH (SSHD) has strict requirements on user management verification, the users added to Busybox basically do not meet the requirements, the main manifestation is that the password is invalid and needs to be manually modified. For example: When you use Busybox to add a user, the/etc/shadow file is generally in the following format: # cat/etc/shadowroot: $1 $ m. jegaqA $ vA. rBTVryyUAcRvyZ2gOL1: 0: 0: 99999: 7 ::: telnetd: $1 $ N4uZUEcU $ yotoDExxgGXs6PE7PQuIR1: 0: 0: 99999: 7 ::: honey: $1 $ SwtHyL/h $ MsEX6Vnqz/qhwDsivDqD20: 0: 0: 99999: 7 ::: sshd: $1 $ elylgRon $ FOHgkwpPMcNI5s. iL8ZS /.: 0: 0: 99999: 7: in this case, a user logon failure occurs when using SSH to log on, and a prompt such as "WARNI NG: Your password has expired. You must change your password now and login again !" And so on. You need to modify it manually, as shown in the following figure: www.2cto.com # cat/etc/shadowroot: $1 $ m. jegaqA $ vA. rBTVryyUAcRvyZ2gOL1: 15695: 5: 99999: 7: 5: 20000: telnetd: $1 $ N4uZUEcU $ yotoDExxgGXs6PE7PQuIR1: 15695: 5: 99999: 7: 5: 20000: honey: $1 $ SwtHyL/h $ MsEX6Vnqz/qhwDsivDqD20: 15695: 5: 99999: 7: 5: 20000: sshd: $1 $ elylgRon $ FOHgkwpPMcNI5s. iL8ZS /.: 15695: 5: 99999: 7: 5: 20000:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.