31. Compile and install Dropbear
32. When creating a remote login, use the directory
33. Generate a key file for the target system
34. Setting up a secure shells
35. Turn on the Network Service conversion function
36. Copy the corresponding library file, the path to correspond, not the creation of
37. Testing
31. Compile and install Dropbear
Dropbear is a relatively small SSH server and client
[[email protected] ~]# tar xf dropbear-2016.73.tar.bz2[[email protected] ~] # cd dropbear-2016.73[[email protected] dropbear-2016.73]# ./configure[[email Protected] dropbear-2016.73]# make && make install copy the corresponding directory to the target host directory ( Created if the directory does not exist) [[email protected] dropbear-2016.73]# which dropbear/usr/local/sbin/dropbear[[ Email protected] dropbear-2016.73]# mkdir /mnt/sysroot/usr/local/sbin/ -pvmkdir: created directory '/mnt/sysroot/usr/local ' mkdir: created directory '/mnt/ Sysroot/usr/local/sbin/' [[Email protected] dropbear-2016.73]# cp /usr/local/sbin/dropbear /mnt/sysroot/usr/local/sbin/[[email protected] dropbear-2016.73]# which dropbearkey/ usr/local/bin/dropbearkey[[email protected] dropbear-2016.73]# mkdir /mnt/sysroot/usr/ local/bin/ -pvmkdir: created directory '/mnt/sysroot/usr/local/bin/' [[EMAIL PROTECTED] DROPBEAR-2016.73]# CP /usr/local/bin/dropbearkey /mnt/sysroot/usr/local/bin/[[email protected] dropbear-2016.73 ]# which dbclient/usr/local/bin/dbclient[[email protected] dropbear-2016.73]# cp /usr/local/bin/dbclient /mnt/sysroot/usr/local/bin/[[email protected] dropbear-2016.73]# tree /mnt/sysroot/usr/local//mnt/sysroot/usr/local/├── bin│ ├── dbclient│ └── dropbearkey└── sbin └── dropbear2 Directories, 3 files
32. When creating a remote login, use the directory
[[email protected] dropbear-2016.73]# cd/mnt/sysroot/[[email protected] sysroot]# mkdir dev/pts[[email protected] sysroot]# vim Etc/fstabsysfs/sys sysfs defaults 0 0proc/proc proc defaults 0 0/dev/sda1/boot ext4 defaults 0 0/dev/sda2 /ext4 defaults 0 0devpts/dev/pts devpts mode=620 0 0--Add this line to enable automatic mount; mode means permission
33. Generate a key file for the target system
[[email protected] sysroot]# mkdir etc/dropbear[[email protected] sysroot]# CD Etc/dropbear/[[email protected] dropbear] # dropbearkey-t Rsa-s 2048-f dropbear_rsa_host_key[[email protected] dropbear]# dropbearkey-t dss-f Dropbear_dss_hos T_key
34. Setting up a secure shells
[Email protected] sysroot]# vim Etc/shells/bin/bash/bin/ash/bin/sh/bin/hush/sbin/nologin
35. Turn on the Network Service conversion function
[[email protected] sysroot]# VIM etc/nsswitch.confpasswd:filesgroup:filesshadow:fileshosts:files DNS
36. Copy the corresponding library file, the path to correspond, not the creation of
[Email protected] sysroot]# mkdir usr/lib64[[email protected] sysroot]# cp-d/lib64/libnss_files* lib64/[[email Protect Ed] sysroot]# cp-d/usr/lib64/libnss3.so usr/lib64/[[email protected] sysroot]# cp-d/usr/lib64/libnssutil3.so usr/lib6 4/[[email protected] sysroot]# cp-d/usr/lib64/libnss_files* usr/lib64/
37. Testing
[[email protected] sysroot]# sync[[email protected] sysroot]# sync off host open mini Linux boot dropbear program use another Linux SSH login to Mini Linux
This article is from the "Homecoming" blog, make sure to keep this source http://sixijie123.blog.51cto.com/11880770/1882126
Build a mini Linux from scratch (7)