dropbear是一個(gè)基于SSH服務(wù)的軟件,是ssh服務(wù)的另一種實(shí)現(xiàn)苇本,是一個(gè)開(kāi)源軟件,系統(tǒng)占用比較小菜拓。因?yàn)閥um倉(cāng)庫(kù)里沒(méi)有dropbear瓣窄,我們可以用編譯安裝的方式安裝dropbear。
安裝dropbear之前尘惧,先確認(rèn)開(kāi)發(fā)包組Development Tools已經(jīng)安裝康栈!
第一步:下載dropbear,推薦網(wǎng)址https://matt.ucc.asn.au/dropbear/
由此可以看出最新版的dropbear為dropbear-2017.75.tar喷橙,點(diǎn)擊下載啥么,保存
第二步:利用rz命令上傳至linux服務(wù)器并解壓
[root@c6 app]#rz
[root@c6 app]#ll
total 1608
-rw-r--r-- 1 root root 1623392 Sep 12 14:21 dropbear-2017.75.tar.bz2
drwx------. 2 root root 16384 Sep 9 20:21 lost+found
-rw------- 1 root root 3879 Sep 12 09:59 sshd_config
[root@c6 app]#tar xvf dropbear-2017.75.tar.bz2
dropbear-2017.75/
dropbear-2017.75/.hg_archival.txt
dropbear-2017.75/.hgsigs
dropbear-2017.75/.travis.yml
......
[root@c6 app]#ll
total 1612
drwx------ 5 501 games 4096 May 18 22:47 dropbear-2017.75
-rw-r--r-- 1 root root 1623392 Sep 12 14:21 dropbear-2017.75.tar.bz2
drwx------. 2 root root 16384 Sep 9 20:21 lost+found
第三步:進(jìn)入解壓后的文件夾,查看軟件說(shuō)明和安裝信息
[root@c6 app]#cd dropbear-2017.75
[root@c6 dropbear-2017.75]#cat README
This is Dropbear, a smallish SSH server and client.
https://matt.ucc.asn.au/dropbear/dropbear.html
INSTALL has compilation instructions.
MULTI has instructions on making a multi-purpose binary (ie a single binary
which performs multiple tasks, to save disk space)
SMALL has some tips on creating small binaries.
See TODO for a few of the things I know need looking at, and please contact
me if you have any questions/bugs found/features/ideas/comments etc :)
Matt Johnston
matt@ucc.asn.au
......
[root@c6 dropbear-2017.75]#cat INSTALL
Basic Dropbear build instructions:
- Edit options.h to set which features you want.
- Edit debug.h if you want any debug options (not usually required).
(If using a non-tarball copy, "autoconf; autoheader")
./configure (optionally with --disable-zlib or --disable-syslog,
or --help for other options)
Now compile:
make PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp"
And install (/usr/local/bin is usual default):
make PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp" install
......
[root@c6 dropbear-2017.75]#./configure --help
`configure' configures this package to adapt to many kinds of systems.
Usage: ./configure [OPTION]... [VAR=VALUE]...
To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE. See below for descriptions of some of the useful variables.
Defaults for the options are specified in brackets.
Configuration:
-h, --help display this help and exit
--help=short display options specific to this package
--help=recursive display the short help of all the included packages
-V, --version display version information and exit
-q, --quiet, --silent do not print `checking ...' messages
--cache-file=FILE cache test results in FILE [disabled]
-C, --config-cache alias for `--cache-file=config.cache'
-n, --no-create do not create output files
--srcdir=DIR find the sources in DIR [configure dir or `..']
......
第四步:根據(jù)安裝信息進(jìn)行Make并安裝
[root@c6 dropbear-2017.75]#./configure
[root@c6 dropbear-2017.75]#make PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp"
.......過(guò)程略過(guò)
[root@c6 dropbear-2017.75]#make PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp" install
install -d /app/dropbear/sbin
install dropbear /app/dropbear/sbin
install -d /app/dropbear/share/man/man8
install -m 644 ./dropbear.8 /app/dropbear/share/man/man8/dropbear.8
install -d /app/dropbear/bin
install dbclient /app/dropbear/bin
install -d /app/dropbear/share/man/man1
if test -e dbclient.1; then install -m 644 dbclient.1 /app/dropbear/share/man/man1/dbclient.1; fi
install -d /app/dropbear/bin
install dropbearkey /app/dropbear/bin
install -d /app/dropbear/share/man/man1
if test -e dropbearkey.1; then install -m 644 dropbearkey.1 /app/dropbear/share/man/man1/dropbearkey.1; fi
install -d /app/dropbear/bin
install dropbearconvert /app/dropbear/bin
install -d /app/dropbear/share/man/man1
if test -e dropbearconvert.1; then install -m 644 dropbearconvert.1 /app/dropbear/share/man/man1/dropbearconvert.1; fi
install -d /app/dropbear/bin
install scp /app/dropbear/bin
install -d /app/dropbear/share/man/man1
if test -e scp.1; then install -m 644 scp.1 /app/dropbear/share/man/man1/scp.1; fi
創(chuàng)建文件夾并生成dropbear密鑰
[root@c6 bin]#mkdir /etc/dropbear/
[root@c6 bin]#dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key
Generating key, this may take a while...
Public key portion is:
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDhBbozSE7+5idJGL3EXoeiA4nY3ND5BdJ6uklzMJmpqAMknCwLCV3RdC0hE8Sh+cdzYw+FAUKEFETaF+oFNAsXtRowUv7/UafRzsZDgRR+Qbw31NYLifFHoHZ5UAKKfnEjXyYN+JX/mi0t1d0wF8Qser4Lc6iaVTZYn7wOQIzjLOCKmTa1Tdd41naeiu14PQUJWLprSTGJ61axCf5otehzXmpfVXZBynOu0LqArxpDBuQUzpyAQsCtNDK/+O2bHy9FVT+M17SRsb+etrA3ogj+JF5+qgi7GPk3qhqk6WOqfDyJJ7YKyhYcfZFarep7wYhAWg+TEMZgOdpIbhyObA4n root@c6
Fingerprint: md5 11:d2:c2:18:8a:98:ae:9f:71:ca:d2:c9:62:8b:84:c5
指定端口贰逾,關(guān)閉防火墻悬荣,并用其他機(jī)器遠(yuǎn)程登錄
[root@c6 sbin]#dropbear -E -p 2222
[9532] Sep 12 13:07:54 Failed loading /etc/dropbear/dropbear_dss_host_key
[9532] Sep 12 13:07:54 Failed loading /etc/dropbear/dropbear_ecdsa_host_key
[9533] Sep 12 13:07:54 Running in background
[root@c7 ~]#ssh 192.168.10.133 -p 2222
The authenticity of host '[192.168.10.133]:2222 ([192.168.10.133]:2222)' can't be established.
RSA key fingerprint is 11:d2:c2:18:8a:98:ae:9f:71:ca:d2:c9:62:8b:84:c5.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[192.168.10.133]:2222' (RSA) to the list of known hosts.
root@192.168.10.133's password:
[root@c6 ~]#
刪除dropbear
[root@c6 sbin]#rm -rf /usr/local/sbin/
[root@c6 sbin]#rm -rf /usr/local/bin/
[root@c6 sbin]#rm -rf /etc/dropbear/