赞
踩
https://quantum6.blog.csdn.net/article/details/136299665
编译时指定prefix,产生的文件会自带这个目录。所以直接忽略。
- ./configure
-
- # 不指定编译路径,手动复制。
编译后的整个目录打包,复制到开发板。写个脚本,内容如下,执行:
- INSTALL=/usr/bin/install
- MKDIR=/usr/bin/mkdir
-
- ${MKDIR} -p -m 0755 /var/empty
-
- U_L_SBIN=/usr/local/sbin
- echo
- echo ${U_L_SBIN}
- ${MKDIR} -p ${U_L_SBIN}
- ${INSTALL} -c -m 0755 sshd ${U_L_SBIN}/sshd
-
- U_L_BIN=/usr/local/bin
- echo
- echo ${U_L_BIN}
- ${MKDIR} -p ${U_L_BIN}
- ${INSTALL} -c -m 0755 ssh ${U_L_BIN}/ssh
- ${INSTALL} -c -m 0755 scp ${U_L_BIN}/scp
- ${INSTALL} -c -m 0755 ssh-add ${U_L_BIN}/ssh-add
- ${INSTALL} -c -m 0755 ssh-agent ${U_L_BIN}/ssh-agent
- ${INSTALL} -c -m 0755 ssh-keygen ${U_L_BIN}/ssh-keygen
- ${INSTALL} -c -m 0755 ssh-keyscan ${U_L_BIN}/ssh-keyscan
- ${INSTALL} -c -m 0755 sftp ${U_L_BIN}/sftp
-
- U_L_LIBEXEC=/usr/local/libexec
- echo
- echo ${U_L_LIBEXEC}
- ${MKDIR} -p ${U_L_LIBEXEC}
- ${INSTALL} -c -m 4711 ssh-keysign ${U_L_LIBEXEC}/ssh-keysign
- ${INSTALL} -c -m 0755 ssh-pkcs11-helper ${U_L_LIBEXEC}/ssh-pkcs11-helper
- ${INSTALL} -c -m 0755 ssh-sk-helper ${U_L_LIBEXEC}/ssh-sk-helper
- ${INSTALL} -c -m 0755 sftp-server ${U_L_LIBEXEC}/sftp-server
-
- U_L_S_M_MAN1=/usr/local/share/man/man1
- echo
- echo ${U_L_S_M_MAN1}
- ${MKDIR} -p ${U_L_S_M_MAN1}
- ${INSTALL} -c -m 644 ssh.1.out ${U_L_S_M_MAN1}/ssh.1
- ${INSTALL} -c -m 644 scp.1.out ${U_L_S_M_MAN1}/scp.1
- ${INSTALL} -c -m 644 ssh-add.1.out ${U_L_S_M_MAN1}/ssh-add.1
- ${INSTALL} -c -m 644 ssh-agent.1.out ${U_L_S_M_MAN1}/ssh-agent.1
- ${INSTALL} -c -m 644 ssh-keygen.1.out ${U_L_S_M_MAN1}/ssh-keygen.1
- ${INSTALL} -c -m 644 ssh-keyscan.1.out ${U_L_S_M_MAN1}/ssh-keyscan.1
- ${INSTALL} -c -m 644 sftp.1.out ${U_L_S_M_MAN1}/sftp.1
-
- U_L_S_M_MAN5=/usr/local/share/man/man5
- echo
- echo ${U_L_S_M_MAN5}
- ${MKDIR} -p ${U_L_S_M_MAN5}
- ${INSTALL} -c -m 644 moduli.5.out ${U_L_S_M_MAN5}/moduli.5
- ${INSTALL} -c -m 644 sshd_config.5.out ${U_L_S_M_MAN5}/sshd_config.5
- ${INSTALL} -c -m 644 ssh_config.5.out ${U_L_S_M_MAN5}/ssh_config.5
-
- U_L_S_M_MAN8=/usr/local/share/man/man8
- echo
- echo ${U_L_S_M_MAN8}
- ${MKDIR} -p ${U_L_S_M_MAN8}
- ${INSTALL} -c -m 644 sshd.8.out ${U_L_S_M_MAN8}/sshd.8
- ${INSTALL} -c -m 644 sftp-server.8.out ${U_L_S_M_MAN8}/sftp-server.8
- ${INSTALL} -c -m 644 ssh-keysign.8.out ${U_L_S_M_MAN8}/ssh-keysign.8
- ${INSTALL} -c -m 644 ssh-pkcs11-helper.8.out ${U_L_S_M_MAN8}/ssh-pkcs11-helper.8
- ${INSTALL} -c -m 644 ssh-sk-helper.8.out ${U_L_S_M_MAN8}/ssh-sk-helper.8
-
- U_L_ETC=/usr/local/etc
- echo
- echo ${U_L_ETC}
- ${MKDIR} -p ${U_L_ETC}
- ${INSTALL} -c -m 644 ssh_config.out ${U_L_ETC}/ssh_config
- ${INSTALL} -c -m 644 sshd_config.out ${U_L_ETC}/sshd_config
- ${INSTALL} -c -m 644 moduli.out ${U_L_ETC}/moduli

ssh-keygen -A
- ssh-keygen -t rsa -f ssh_host_rsa_key -N ""
- ssh-keygen -t dsa -f ssh_host_dsa_key -N ""
- ssh-keygen -t ecdsa -f ssh_host_ecdsa_key -N ""
- ssh-keygen -t dsa -f ssh_host_ed25519_key -N ""
sshd: Privilege separation user sshd does not exist-CSDN博客
我的板子缺少libz.so/libcrypto.so,复制到/lib64下,解决。
- /usr/local/sbin/sshd
- sshd: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
-
-
- lrwxrwxrwx 1 root root 9 Jan 1 00:15 /lib64/libz.so -> libz.so.1
- lrwxrwxrwx 1 root root 14 Jan 1 00:15 /lib64/libz.so.1 -> libz.so.1.2.11
- -rw-r----- 1 root root 117032 Jan 1 00:15 /lib64/libz.so.1.2.11
-
- lrwxrwxrwx 1 root root 16 Jan 1 00:15 /lib64/libcrypto.so -> libcrypto.so.1.1
- -rw-r----- 1 root root 2711280 Jan 1 00:15 /lib64/libcrypto.so.1.1
/usr/local/sbin/sshd -t -f /usr/local/etc/sshd_config
通过SSH使用ROOT账号无法登录,提示禁止访问Access denied_ssh root拒绝访问-CSDN博客
- /usr/local/sbin/sshd -f /usr/local/etc/sshd_config
-
- ps | grep sshd
- 1501 root 0:00 sshd: /usr/local/sbin/sshd -f /usr/local/etc/sshd_config [listener
可以看到已经启动到后台了。可以使用ssh登录了。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。