[toc] ##以下为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:~ #