You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

179 lines
5.3 KiB

<style type="text/css">
pre {
margin-left: 2em;
<!-- NetBSD logo, right-aligned. Non-commercial use is permitted. -->
<div style="float:right;margin-right:1em;">
<img src=""/>
<h1>NetBSD on SDF VPS</h1>
<a href="#first_steps">First Steps</a>
<li><a href="#user_accounts">User Accounts</a></li>
<li><a href="#system_clock">System Clock</a></li>
<li><a href="#networking">Networking</a></li>
<li><a href="#pkgsrc">pkgsrc</a></li>
<li><a href="#tips">Miscellaneous Tips</a></li>
<li><a href="#references">References</a></li>
<h2 id="first_steps">First Steps</h2>
<h3 id="user_accounts">User Accounts</h3>
<p>After you have installed and started your NetBSD VPS, go to the
console and log-in as user root with the default password, "root".</p>
<p>One of the first things you
will want to do is change the default root password by typing
<code>passwd</code> at the prompt. Don't forget this password as there is
currently no way to recover it.</p>
<p>It is also a good habit to create a regular user account for
working, using <code>su</code> to obtain root privileges as needed.
To create a regular user account which is part of the administrative
<code>wheel</code> group:</p>
<pre>useradd -m -G wheel &lt;username&gt;</pre>
<p>Then immediately set its password with:</p>
<pre>passwd &lt;username&gt;</pre>
<p>This user will be in the <code>wheel</code> group and will be able
to perform administrative tasks by runing <code>su</code> to obtain
superuser privileges using the root password.</p>
<h3 id="system_clock">System Clock</h3>
<p>It is customary on UNIX systems for the system clock to be set
to UTC. To set the local time zone, find your zone file in
<code>/usr/share/zoneinfo/</code> and link to it at
<code>/etc/localtime</code> as follows:</p>
<pre>ln -fs /usr/share/zoneinfo/Europe/Helsinki /etc/localtime</pre>
<h3 id="networking">Networking</h3>
<p>Look at the first line of your control panel at and note YOUR_HOSTNAME
(e.g. netbsd99), EXTERNAL_IP (e.g. 205.166.94.nnn), and INTERNAL_IP
(e.g. 10.1.0.nnn):</p>
VPS Maintenance Shell for netbsd99 (205.166.94.nnn / 10.1.0.nnn)
-------- ------------- ----------
^ ^ ^
| | |
<p>Open /etc/rc.conf in an editor and, replacing the text YOUR_HOSTNAME,
INTERNAL_IP with your own actual host name and IP numbers, add:</p>
ifconfig_xennet0="inet EXTERNAL_IP netmask 0xffffff00"
ifconfig_xennet1="inet INTERNAL_IP netmask 0xffffff00"
<p>Then put this in /etc/resolv.conf:</p>
<p>Add this to /etc/hosts:</p>
<pre>/etc/rc.d/network restart</pre>
<h2 id="pkgsrc">pkgsrc</h2>
<p>On NetBSD you can mount a pre-built (and still in progress) pkgsrc DESTDIR.
Following the procedures below will effectively install the 2000+ included
packages on your virtual NetBSD system.</p>
<p>Note that at the moment the pre-built pkgsrc assumes that its
path is /pkgshare. Some programs won't work under a different
prefix since they won't be able to find their shared libraries.</p>
mkdir -p /pkgshare
rmdir /usr/pkg
ln -s /pkgshare /usr/pkg
rm -rf /var/db/pkg
ln -s /pkgshare/db/pkg /var/db/pkg
mount -t nfs /pkgshare
export PATH=$PATH:/usr/pkg/bin:/usr/pkg/sbin
<p>It is read only.</p>
<p>To set this up on boot, execute the steps above and then:</p>
echo "nfs_client=YES" >> /etc/rc.conf
echo "rpcbind=YES" >> /etc/rc.conf
echo " vps" >> /etc/hosts
echo "vps:/pkgshare /pkgshare nfs ro" >> /etc/fstab
echo "export PATH=$PATH:/usr/pkg/bin:/usr/pkg/sbin" >> /etc/profile
<p>Note that you cannot use both this pre-built pkgsrc and pre-built packages
from It may be possible to set the system up so you can, however
this is best left to the experienced NetBSD administrator.</p>
<h2 id="tips">Miscellaneous Tips</h2>
<h3>Free up disk space by removing unwanted sets</h3>
<p>The default image comes with all distribution sets installed. You can free
up some disk space by removing the ones you don't need.</p>
<p>First, check which distribution sets are installed:</p>
<pre>ls /etc/mtree</pre>
<p>Decide which sets you want to remove and examine their contents. For example,
to remove games and all X11 sets:</p>
for set in games xbase xcomp xetc xfont xserver ; do \
tar tzf /usr/INSTALL/$set.tgz | sed -e 's/^\.//' &gt;&gt; /tmp/purgelist ; \
<p>After examining <code>/tmp/purgelist</code> and removing any files you want to
keep, do:</p>
<pre>cat /tmp/purgelist | xargs rm</pre>
<h2 id="references">References</h2>
<li><a href="">The NetBSD Guide</a></li>
<li><a href="">The
NetBSD System Manager's Manual</a></li>
<hr />
$Id: VPS_NetBSD.html,v 1.23 2018/02/22 15:12:01 slugmax Exp $