author | Oleksandr Gavenko <gavenkoa@gmail.com> |
Tue, 29 Jan 2019 18:00:52 +0200 | |
changeset 2350 | 1141a548cbb6 |
parent 1983 | af615af2ad5f |
permissions | -rw-r--r-- |
1982 | 1 |
.. -*- coding: utf-8; -*- |
2 |
||
3 |
======== |
|
4 |
NetBSD |
|
5 |
======== |
|
6 |
.. contents:: |
|
7 |
:local: |
|
8 |
||
9 |
User management |
|
10 |
=============== |
|
11 |
||
12 |
User in ``wheel`` group automatically get ``root`` permission with ``su`` |
|
13 |
command, use one of:: |
|
14 |
||
15 |
$ su |
|
16 |
$ su - |
|
17 |
||
1983
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
18 |
Also ``wheel`` group allow access to system logs. |
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
19 |
|
1982 | 20 |
To set user password:: |
21 |
||
22 |
$ passwd $USER |
|
23 |
||
24 |
To set user shell:: |
|
25 |
||
26 |
$ chsh |
|
27 |
$ chpass -s /bin/ksh |
|
28 |
||
29 |
Network configuration |
|
30 |
===================== |
|
31 |
||
32 |
Set host name:: |
|
33 |
||
34 |
$ hostname $HOST |
|
35 |
$ echo $HOST > /etc/myname |
|
36 |
||
37 |
Manually setup DHCP:: |
|
38 |
||
39 |
$ ifconfig # find out available interfaces |
|
40 |
$ dhclient $IF |
|
41 |
$ ifconfig # check out if thinks go ok |
|
42 |
||
1983
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
43 |
Set DNS resolution by modifying ``/etc/resolve.conf``:: |
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
44 |
|
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
45 |
domain example.local |
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
46 |
nameserver DNS1 |
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
47 |
nameserver DNS2 |
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
48 |
|
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
49 |
Set local host name resolution by modifying ``/etc/hosts``:: |
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
50 |
|
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
51 |
::1 localhost localhost. |
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
52 |
127.0.0.1 localhost localhost. |
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
53 |
|
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
54 |
Set static IP address to interface by adding file ``/etc/hostname.$IF``:: |
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
55 |
|
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
56 |
inet IP NETMASK |
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
57 |
|
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
58 |
Applay network configuration:: |
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
59 |
|
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
60 |
$ /etc/rc.d/network restart |
1982 | 61 |
|
62 |
Package management |
|
63 |
================== |
|
64 |
||
65 |
Easy way to install packages is to put:: |
|
66 |
||
67 |
export PKG_PATH=ftp://ftp.NetBSD.org/pub/pkgsrc/packages/NetBSD/$(uname -m)/7.0/All |
|
68 |
||
69 |
into ``/root/.profile`` and run as root one of:: |
|
70 |
||
71 |
$ pkg_add emacs |
|
72 |
$ pkg_add -v emacs |
|
73 |
||
1983
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
74 |
System wide environment variable set in ``/etc/profile``. |
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
75 |
|
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
76 |
Update userland packages:: |
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
77 |
|
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
78 |
$ pkg_add -uu $PKG1 $PKG2 |
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
79 |
|
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
80 |
Remove installed package:: |
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
81 |
|
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
82 |
$ pkg_delete $PKG |
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
83 |
|
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
84 |
|
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
85 |
Halting |
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
86 |
======= |
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
87 |
:: |
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
88 |
|
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
89 |
$ shutdown -p now |
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
90 |
|
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
91 |
Enable SSH |
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
92 |
========== |
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
93 |
|
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
94 |
Add ``ntpd=YES`` to ``/etc/rc.conf``. |
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
95 |
|
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
96 |
Enable NTP |
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
97 |
========== |
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
98 |
|
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
99 |
Adjust server in ``/etc/ntp.conf``:: |
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
100 |
|
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
101 |
server time.mit.edu |
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
102 |
|
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
103 |
Add ``ntpd=YES`` to ``/etc/rc.conf``. |
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
104 |
|
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
105 |
Bootloader |
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
106 |
========== |
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
107 |
|
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
108 |
To enable VESA framebuffer edit ``/boot.cfg``:: |
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
109 |
|
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
110 |
menu=Boot NetBSD:vesa 1280x800;boot netbsd |
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
111 |
|
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
112 |
To disable ACPI edit ``/boot.cfg``:: |
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
113 |
|
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
114 |
default=3 |
af615af2ad5f
Network configuration. Enable SSH. Enable NTP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1982
diff
changeset
|
115 |