允許SSH 訪問(wèn)
編輯 /etc/rc.conf 文件
sshd_enable = "YES"
啟動(dòng) sshd
# /etc/cd.c/sshd start
登錄慢
當(dāng) SSH client 連接到server后该押,server會(huì)向 /etc/resolv.conf 中的nameserver 請(qǐng)求 client 端 IP 的逆向解析破讨,而 client 端 IP(或者是client端IP對(duì)應(yīng)的域名扫皱?)在 nameserver 中不存在瓜喇,所以會(huì)很慢。
編輯 /etc/ssh/sshd_config 文件
# vim /etc/ssh/sshd_config
#UseDNS yes
UseDNS no
:wq
# /etc/rc.d/sshd restart
JDK
使用 pkg 安裝
# pkg search ^openjdk
openjdk-7.251.02.1,1 Java Development Kit 7
openjdk-jre-7.251.02.1,1 Java Development Kit 7
openjdk11-11.0.6+10.1_1 Java Development Kit 11
openjdk12-12.0.2+10.3_1 Java Development Kit 12
openjdk13-13.0.2+8.1 Java Development Kit 13
openjdk14-14+36.1 Java Development Kit 14
openjdk8-8.242.07.1 Java Development Kit 8
openjdk8-jre-8.242.07.1 Java Runtime Environment 8
# pkg install openjdk8-8.242.07.1
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 4 package(s) will be affected (of 0 checked):
New packages to be INSTALLED:
java-zoneinfo: 2019.b
javavmwrapper: 2.7.5
libinotify: 20180201_1
openjdk8: 8.242.07.1
Number of packages to be installed: 4
The process will require 191 MiB more space.
80 MiB to be downloaded.
Proceed with this action? [y/N]: y
# 忽略了中間的輸出 ...
Message from libinotify-20180201_1:
--
Libinotify functionality on FreeBSD is missing support for
- detecting a file being moved into or out of a directory within the
same filesystem
- certain modifications to a symbolic link (rather than the
file it points to.)
in addition to the known limitations on all platforms using kqueue(2)
where various open and close notifications are unimplemented.
This means the following regression tests will fail:
Directory notifications:
IN_MOVED_FROM
IN_MOVED_TO
Open/close notifications:
IN_OPEN
IN_CLOSE_NOWRITE
IN_CLOSE_WRITE
Symbolic Link notifications:
IN_DONT_FOLLOW
IN_ATTRIB
IN_MOVE_SELF
IN_DELETE_SELF
Kernel patches to address the missing directory and symbolic link
notifications are available from:
https://github.com/libinotify-kqueue/libinotify-kqueue/tree/master/patches
You might want to consider increasing the kern.maxfiles tunable if you plan
to use this library for applications that need to monitor activity of a lot
of files.
=====
Message from openjdk8-8.242.07.1:
--
This OpenJDK implementation requires fdescfs(5) mounted on /dev/fd and
procfs(5) mounted on /proc.
If you have not done it yet, please do the following:
mount -t fdescfs fdesc /dev/fd
mount -t procfs proc /proc
To make it permanent, you need the following lines in /etc/fstab:
fdesc /dev/fd fdescfs rw 0 0
proc /proc procfs rw 0 0
OpenJDK實(shí)現(xiàn)需要安裝幾個(gè)文件系統(tǒng)以實(shí)現(xiàn)完整功能。 運(yùn)行以下命令立即執(zhí)行所需的安裝:
$ sudo mount -t fdescfs fdesc /dev/fd
$ sudo mount -t procfs proc /proc
為了使這種更改永久肤无,我們必須添加這些掛載點(diǎn)槽惫, /etc/fstab的文件周叮。 打開(kāi)要立即編輯的文件:
$ sudo vi /etc/fstab
將以下安裝信息插入到文件中:
fdesc /dev/fd fdescfs rw 0 0
proc /proc procfs rw 0 0
保存并退出。
最后界斜,您將需要重新哈希仿耽,以確保您可以立即使用您的新Java二進(jìn)制文件:
$ rehash
使用 ports 安裝
$ cd /usr/ports/java && ls -d openjdk*
openjdk11 openjdk13 openjdk7-jre openjdk8-jre
openjdk12 openjdk7 openjdk8
# cd /usr/ports/java/openjdk8
# make install clean
您將看到一系列提示,要求您選擇要構(gòu)建Java端口及其依賴(lài)關(guān)系的選項(xiàng)和庫(kù)各薇。 您可以接受默認(rèn)值或根據(jù)您的需要自定義项贺。
在您回答所有提示后,將構(gòu)建并安裝OpenJDK端口及其依賴(lài)項(xiàng)峭判。
這個(gè)OpenJDK實(shí)現(xiàn)需要安裝幾個(gè)文件系統(tǒng)以實(shí)現(xiàn)完整功能开缎。 運(yùn)行以下命令立即執(zhí)行所需的安裝:
$ sudo mount -t fdescfs fdesc /dev/fd
$ sudo mount -t procfs proc /proc
為了使這種更改永久,我們必須添加這些掛載點(diǎn)林螃, /etc/fstab的文件奕删。 打開(kāi)要立即編輯的文件:
$ sudo vi /etc/fstab
將以下安裝信息插入到文件中:
fdesc /dev/fd fdescfs rw 0 0
proc /proc procfs rw 0 0
保存并退出。
最后疗认,您將需要重新哈希完残,以確保您可以立即使用您的新Java二進(jìn)制文件:
$ rehash
您選擇的OpenJDK端口現(xiàn)在已安裝并準(zhǔn)備使用!
參考:
https://www.ostechnix.com/how-to-enable-ssh-on-freebsd/
https://www.howtoing.com/how-to-install-java-on-freebsd-10-1/