1. 네트워크 설정하기
/etc/hosts
/etc/resolv.conf
/etc/ifconfig.xxx
/etc/mygate
/etc/nsswitch.conf
# cat hosts
: : 1 localhost
127.0.0.1 localhost
192.168.0.60 mynetbsd.net mynetbsd ->이것은 NetBSD의 IP주소이다.
# cat resolv.conf
nameserver 168.126.63.1 -> 한국통신DNS
search net
# cat ifconfig.le0
196.168.0.60 netmask 0xffffff00 media autoselect
# mygate
192.168.0.1 -->이것은 게이트웨이로 현재 내 컴은 nat서버를 사용한다.
# nsswitch.conf
group: compat
group_compat: nis
hosts: files dns
netgroup: files [notfound=return] nis
networks: files
passwd: compat
passwd_compat: nis
ifconfig 를 이용한 설정
# ifconfig le0 ->네트워크카드 확인
le0: flags=8822 mtu 1500 media: Ethernet autoselect
# ifconfig le0 inet 192.168.0.60 netmask 0xffffff00
# ifconfig le0 --> 확인
le0: flags=8863 mtu 1500
media: Ethernet autoselect
status: active
inet 192.168.0.60 netmask 0xffffff00 broadcast 192.168.0.255
inet6 fe80: :250:56ff:fe40:8c%le0 prefixlen 64 duplicated scopeid 0x1
참고로 내 NIC는 3Com 3C920 Integrated Fast Ethernet Controller 이다.
* 나의 경우는 NetBSD를 부팅했을적에 자동으로 네트워크 인식을 못하여
/etc/rc.conf 에서
rc_configured=YES
wscons=YES
auto_ifconfig = NO
라고 하니까....인결이 제대로 되었다.
2. 패키지 추가하기
apache패키지를 설치해보자.
NetBSD또한 프비와같이 BSD4.4계열에서 발전되었다.
프비와 사촌이랄까. 그래서 그런지 프비와 명령이 거의 비슷하다.
어떤 패키지가 설치되어있는지는
# pkg_info 로 확인한다.
# pkg_add ftp://ftp.netbsd.org/pub/NetBSD/packages/1.5.2/i386/All/apache6-1.3.19
하면 아파치를 서버에서 받어와 설치를 한다.
패키지를 지울려면
# pkg_delete apache
아파치 시작은
/usr/pkg/sbin/apachectl start | stop 하면된다.
설정파일은
/usr/pkg/etc/httpd/httpd.conf 이다.
기본 디렉토리는
/usr/pkg/share/httpd/htdocs/ 이다.
3. 사용자 등록
아래는 mymy그룹을 만든다.
# groupadd mymy
사용자 등록
# useradd -G wheel -g mymy -m -s /bin/ksh mymy
-G 이것은 그룹을 정해준다. 위에서는 wheel그룹에 포함된다.
-g 새로운 사용자 mymy를 그룹에 등록한다.
-m 사용자 디렉토리를 정한다.
-s 쉘을 정한다.
mymy라는 새로운 유저를 만든다.
아래는 디폴트 옵션을 적용한다.
# useradd -D -s /bin/ksh
# useradd –D
4. 싱글모드로 들어가기
NetBSD를 부팅하면 아래와 같이 메세지가 나온다.
약 5초동안 카운트를하는데....
Booting fd0a:netbsd - starting in ...
여기서 엔터를 제외한 다른 키를 누르면 아래의 메세지가 나온다.
여기서 아래와같이 ?하면 help가 보인다.
boot -s라고 입력하던가 아님 아래와 같이 파일네임을 정해주준다.
type "?" or "help" for help.
> ?
commands are:
boot [xdNx:][filename] [-adrs]
(ex. "sd0a:netbsd.old -s")
ls [path]
dev xd[N[x]]:
help|?
quit
> boot wd0a:netbsd