0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

KaliLinuxのバーチャルボックスへのインストール。NATネットワーク設定、SSH接続まで…

Posted at

この辺りもつまずいたので備忘録。

NATNetworkにて以下のように設定。
image.png

ゲストOSにはIPを10.0.2.5に設定することを前提に設定。
ホストポートはSSH接続で使うので覚えておく
image.png

ネットワーク設定は以下で設定
image.png

起動して端末を開く。
image.png

IP設定
sudo vi /etc/network/interfaces

以下のように書き換える
# The loopback network interface
auto lo
iface lo inet loopback
allow-hotplug eth0
iface eth0 inet static
address 10.0.2.5 #ゲストOSのIP
netmask 255.255.255.0
gateway 10.0.2.1 #デフォルトGW(必ず末尾が.1になる。ここハマった。)
dns-nameservers 192.168.100.1

再起動
sudo systemctl restart networking.service

ipアドレス確認
$ ip a
1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host noprefixroute
valid_lft forever preferred_lft forever
2: eth0: mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 08:00:27:36:8f:f4 brd ff:ff:ff:ff:ff:ff
inet 10.0.2.5/24 brd 10.0.2.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::a00:27ff:fe36:8ff4/64 scope link proto kernel_ll
valid_lft forever preferred_lft forever

SSHサーバインストール
$ sudo apt update
$ sudo apt install openssh-server

$ sudo systemctl enable sshd
$ sudo systemctl start sshd

SSH起動確認
$ sudo systemctl status ssh

SSH接続する
localhost:ホストポートでOK
image.png

ログイン情報を入力
image.png

ログインできた!
image.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?