freebsd配置sshd_conf文件

如下爲sshd配置信息

root@freebsd:/etc/ssh # cd /etc/ssh/
root@freebsd:/etc/ssh # egrep -v '^$|^#' sshd_config
PermitRootLogin yes #容許root遠程登陸
MaxAuthTries 6000 #認證次數
PubkeyAuthentication no #禁用公鑰
PermitEmptyPasswords no #禁用空密碼
UsePAM no #禁止使用PAM
UseDNS no #禁止使用DNS
Subsystem	sftp	/usr/libexec/sftp-server #遠程ftp
	AllowTcpForwarding yes #容許tcp鏈接
PasswordAuthentication yes #開啓密碼驗證
AllowUsers root #容許root登陸

重啓sshd服務

root@freebsd:/etc/ssh # /etc/rc.d/sshd restart
Performing sanity check on sshd configuration.
Stopping sshd.
Waiting for PIDS: 5717.
Performing sanity check on sshd configuration.
Starting sshd.

登陸成功

[C:\~]$ ssh root@192.168.148.40


Connecting to 192.168.148.40:22...
Connection established.
To escape to local shell, press 'Ctrl+Alt+]'.

WARNING! The remote SSH server rejected X11 forwarding request.
Last login: Wed Nov 27 23:12:24 2019 from 192.168.148.2
FreeBSD 12.0-RELEASE r341666 GENERIC 

Welcome to FreeBSD!

Release Notes, Errata: https://www.FreeBSD.org/releases/
Security Advisories:   https://www.FreeBSD.org/security/
FreeBSD Handbook:      https://www.FreeBSD.org/handbook/
FreeBSD FAQ:           https://www.FreeBSD.org/faq/
Questions List: https://lists.FreeBSD.org/mailman/listinfo/freebsd-questions/
FreeBSD Forums:        https://forums.FreeBSD.org/

Documents installed with the system are in the /usr/local/share/doc/freebsd/
directory, or can be installed later with:  pkg install en-freebsd-doc
For other languages, replace "en" with a language code like de or fr.

Show the version of FreeBSD installed:  freebsd-version ; uname -a
Please include that output and any error messages when posting questions.
Introduction to manual pages:  man man
FreeBSD directory layout:      man hier

Edit /etc/motd to change this login announcement.
root@freebsd:~ #
相關文章
相關標籤/搜索