netbsd.rst
author Oleksandr Gavenko <gavenkoa@gmail.com>
Sun, 03 Jan 2021 23:37:00 +0200
changeset 2492 bd3d45148652
parent 1983 af615af2ad5f
permissions -rw-r--r--
Fixed example.

.. -*- coding: utf-8; -*-

========
 NetBSD
========
.. contents::
   :local:

User management
===============

User in ``wheel`` group automatically get ``root`` permission with ``su``
command, use one of::

  $ su
  $ su -

Also  ``wheel`` group allow access to system logs.

To set user password::

  $ passwd $USER

To set user shell::

  $ chsh
  $ chpass -s /bin/ksh

Network configuration
=====================

Set host name::

  $ hostname $HOST
  $ echo $HOST > /etc/myname

Manually setup DHCP::

  $ ifconfig       # find out available interfaces
  $ dhclient $IF
  $ ifconfig       # check out if thinks go ok

Set DNS resolution by modifying ``/etc/resolve.conf``::

  domain example.local
  nameserver DNS1
  nameserver DNS2

Set local host name resolution by modifying ``/etc/hosts``::

  ::1 localhost localhost.
  127.0.0.1 localhost localhost.

Set static IP address to interface by adding file ``/etc/hostname.$IF``::

  inet IP NETMASK

Applay network configuration::

  $ /etc/rc.d/network restart

Package management
==================

Easy way to install packages is to put::

  export PKG_PATH=ftp://ftp.NetBSD.org/pub/pkgsrc/packages/NetBSD/$(uname -m)/7.0/All

into ``/root/.profile`` and run as root one of::

  $ pkg_add emacs
  $ pkg_add -v emacs

System wide environment variable set in ``/etc/profile``.

Update userland packages::

  $ pkg_add -uu $PKG1 $PKG2

Remove installed package::

  $ pkg_delete $PKG


Halting
=======
::

  $ shutdown -p now

Enable SSH
==========

Add ``ntpd=YES`` to ``/etc/rc.conf``.

Enable NTP
==========

Adjust server in ``/etc/ntp.conf``::

  server time.mit.edu

Add ``ntpd=YES`` to ``/etc/rc.conf``.

Bootloader
==========

To enable VESA framebuffer edit ``/boot.cfg``::

  menu=Boot NetBSD:vesa 1280x800;boot netbsd

To disable ACPI edit ``/boot.cfg``::

  default=3