« 【勉強会】Linux Live USB Creator | メイン | 【勉強会】ネットワークの構築 »

【勉強会】BackTrackにopenssh-serverをインストール

普通はデフォルトで使えるようになっている物かと思っていましたが、sshdを利用する準備が若干ややこしかったのでそのメモです。

openssh-serverをインストール

BackTrack5をローカルで操作する場合は不要ですが、sshでBackTrackにアクセスして操作したい場合は、BackTrackにopenssh-serverをインストールする必要があります。 以下その作業メモとなります。


root@bt:/etc/ssh# /usr/sbin/sshd ←sshdを起動しようとした
Could not load host key: /etc/ssh/ssh_host_rsa_key ←keyが無いと怒られた
Could not load host key: /etc/ssh/ssh_host_dsa_key ←keyが無いと怒られた
Missing privilege separation directory: /var/run/sshd ←ディレクトリが無いと怒られた
root@bt:/var/run# apt-get --reinstall install openssh-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reinstallation of openssh-server is not possible, it cannot be downloaded.
0 upgraded, 0 newly installed, 0 to remove and 37 not upgraded.
root@bt:/var/run# apt-get remove openssh-server ←インストールしなおすため、一旦アンインストール
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
openssh-server
0 upgraded, 0 newly installed, 1 to remove and 37 not upgraded.
After this operation, 782kB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 266224 files and directories currently installed.)
Removing openssh-server ...
stop: Unknown instance:
Processing triggers for man-db ...
Processing triggers for ufw ...
Processing triggers for ureadahead ...
root@bt:/var/run#
root@bt:/var/run#
root@bt:/var/run# apt-get install openssh-server  ←sshdをインストール
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
openssh-server: Depends: openssh-client (= 1:5.3p1-3ubuntu6) but 1:5.3p1-3ubuntu7 is to be installed
E: Broken packages ←openssh-clientのバージョンとの相性が悪いから、sshdをインストールできないと怒られた
root@bt:/var/run# apt-get remove openssh-client  ←一旦openssh-clientをアンインストール
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
cisco-torch libnet-ssh-perl openssh-client
0 upgraded, 0 newly installed, 3 to remove and 37 not upgraded.
After this operation, 1,995kB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 266212 files and directories currently installed.)
Removing cisco-torch ...
Removing libnet-ssh-perl ...
Removing openssh-client ...
Processing triggers for desktop-file-utils ...
Processing triggers for python-gmenu ...
Rebuilding /usr/share/applications/desktop.en_US.utf8.cache...
Processing triggers for man-db ...
Processing triggers for python-support ...
root@bt:/var/run# apt-get install openssh-server ←sshdをインストール
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
openssh-client
Suggested packages:
ssh-askpass libpam-ssh keychain openssh-blacklist openssh-blacklist-extra
rssh molly-guard
The following NEW packages will be installed:
openssh-client openssh-server
0 upgraded, 2 newly installed, 0 to remove and 37 not upgraded.
Need to get 1,046kB of archives.
After this operation, 2,695kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://32.repository.backtrack-linux.org/ revolution/main openssh-client 1:5.3p1-3ubuntu6 [761kB]
Get:2 http://32.repository.backtrack-linux.org/ revolution/main openssh-server 1:5.3p1-3ubuntu6 [286kB]
Fetched 1,046kB in 7s (139kB/s)
Preconfiguring packages ...
Selecting previously deselected package openssh-client.
(Reading database ... 266130 files and directories currently installed.)
Unpacking openssh-client (from .../openssh-client_1%3a5.3p1-3ubuntu6_i386.deb) ...
Selecting previously deselected package openssh-server.
Unpacking openssh-server (from .../openssh-server_1%3a5.3p1-3ubuntu6_i386.deb) ...
Processing triggers for man-db ...
Processing triggers for ureadahead ...
Processing triggers for ufw ...
Setting up openssh-client (1:5.3p1-3ubuntu6) ...
update-alternatives: error: no alternatives for rsh.
update-alternatives: error: no alternatives for rlogin.
update-alternatives: error: no alternatives for rcp.

Setting up openssh-server (1:5.3p1-3ubuntu6) ...
Installing new version of config file /etc/init.d/ssh ...
Creating SSH2 RSA key; this may take some time ...
Creating SSH2 DSA key; this may take some time ...
ssh start/running, process 13685

root@bt:/var/run# apt-get install openssh-client ←openssh-clientをインストール
Reading package lists... Done
Building dependency tree
Reading state information... Done
openssh-client is already the newest version.
openssh-client set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 37 not upgraded.
root@bt:/var/run# ssh ←ssh-clientが動くことを確認
usage: ssh [-1246AaCfgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]
[-D [bind_address:]port] [-e escape_char] [-F configfile]
[-i identity_file] [-L [bind_address:]port:host:hostport]
[-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
[-R [bind_address:]port:host:hostport] [-S ctl_path]
[-w local_tun[:remote_tun]] [user@]hostname [command]
root@bt:/var/run# whereis sshd
sshd: /usr/sbin/sshd /usr/share/man/man8/sshd.8.gz
root@bt:/var/run# /usr/sbin/sshd ←sshdを起動
root@bt:/var/run#
root@bt:/var/run# ssh user@localhost ←自分自身へssh接続
The authenticity of host "localhost (::1)" can"t be established.
RSA key fingerprint is 8b:ac:d2:1b:2c:04:0b:7c:75:d3:5f:47:7b:88:cb:aa.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added "localhost" (RSA) to the list of known hosts.
user@localhost"s password:
Linux bt 3.2.6 #1 SMP Fri Feb 17 10:40:05 EST 2012 i686 GNU/Linux

System information as of Sun May 12 00:11:10 EDT 2013

System load: 0.23 Processes: 110
Usage of /: 76.7% of 19.06GB Users logged in: 1
Memory usage: 37% IP address for eth2: 192.168.2.6
Swap usage: 0%

=> There is 1 zombie process.

Graph this data and manage this system at https://landscape.canonical.com/

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

Could not chdir to home directory /home/user: No such file or directory
user@bt:/$

トラックバック

このエントリーのトラックバックURL:
http://www.ddhost.jp/mt/mt-tb.cgi/734

About

2013年05月15日 20:28に投稿されたエントリーのページです。

ひとつ前の投稿は「【勉強会】Linux Live USB Creator」です。

次の投稿は「【勉強会】ネットワークの構築」です。

他にも多くのエントリーがあります。メインページアーカイブページも見てください。