kk Blog —— 通用基础


date [-d @int|str] [+%s|"+%F %T"]
netstat -ltunp
sar -n DEV 1

freeBSD9.2 安装 && 允许root用户用SSH登录

http://forums.freebsd.org/showthread.php?t=36579

Issue:
Here is the error message that I’ve got:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Code:

cd0 at umass-sim0 bus 0 scbus3 target 0 lun 0
cd0: <ASUS SDRW-08D2S-U B302> Removable CD-ROM SCSI-0 device
cd0: 40.000MB/s transfers
cd0: cd present [1166275 x 2048 byte records]Mounting from cd9660:/dev/iso9660/FREEBSD_INSTALL failed with error 19.

Loader variables:
	vfs.root.mountfrom=cd9660:/dev/iso9660/FREEBSD_INSTALL
	vfs.root.mountfrom.option=ro

Manual root filesystem specification:
	<fstype>:<device> [option]
	    Mount <device> using filesystem <fstype>
	    and with the specified (optional) option list.

	eg. ufs:/dev/da0s1a
	    zf:tank

The system seems to recognize the DVD drive but is unable to mount the media correctly.

You need to get a boot prompt and disable ACPI support before booting:
这两句好像没效果

1
2
# set debug.acpi.disabled ="hostres"
# boot

The solution is actually in the FreeBSD 9 errata (section 3)

1
mountroot> cd9660:/dev/cd0  用这句通过

这句不只道可不可以:

1
mountroot> cd9660:/iso9660/FREEBSD_INSTALL

二 FreeBSD 允许root用户用SSH登录

修改freebsd可以用sshd权限用户登录ssh
在/etc/ssh/sshd_config最后中加入

1
2
3
PermitRootLogin yes #允许root登录
PermitEmptyPasswords no #不允许空密码登录
PasswordAuthentication yes # 设置是否使用口令验证。

FreeBSD SSH配置详解 首先vi编辑/etc/inetd.conf,去掉ssh前的#,保存退出 (开启监听ssh服务)
编辑/etc/rc.conf
最后加入:sshd_enable=“yes"即可

激活sshd服务:

1
#/etc/rc.d/sshd start

用下面命令检查服务是否启动,在22端口应该有监听。

1
#netstat -an ## check port number 22

最后

vi /etc/ssh/sshd_config

1
2
3
4
5
6
7
8
9
10
...
Subsystem sftp /usr/libexec/sftp-server
IgnoreRhosts yes
IgnoreUserKnownHosts yes
PrintMotd yes
StrictModes no
RSAAuthentication yes
PermitRootLogin yes #允许root登录
PermitEmptyPasswords no #不允许空密码登录
PasswordAuthentication yes # 设置是否使用口令验证。

记得修改完配置文件后,重新启动sshd服务器(/etc/rc.d/sshd restart)即可。
几点补充说明

1
2
3
4
5
6
7
8
9
10
11
1,如果重启后还是不行请重新载入sshd_config 文件
/etc/rc.d/sshd reload
2,如果出现using keyboard-interactive authentication
password:
请确认PasswordAuthentication是否已经改成yes
另外如果客户端是putty那么请确认"尝试'智能键盘'认证(SSH-2)"的勾是否有去掉
3,如果是使用root帐号登陆
请确认密码是否为空
空密码无法登陆
4请确认是否有安装SSH
sysinstall>>>configure>>>networking>>>sshd是否的勾是否有打上