Commit Briefs

355d1fd4a8 Stefan Sperling

ensure that edited files get unlocked if the user types Ctrl-C at prompt (edit-ctrlc)

While editing files, temporarily disable the default SIGINT handler which does a long jump to displaying a command prompt. Otherwise we would jump away without removing our lock on the file and future attempts to edit the file would fail. Issue found by Tom Smyth.



957f3c72fb Stefan Sperling

fix make search path in bgpnsh and nshdoas directories

This Makefile grammar fix makes our build system independent of 'make obj', which is now an entirely optional step.


73decf3449 GitHub

improve nsh.8 accuracy and general syntax

improve accuracy of description of what happens nsh when you start it as root and non root user improved syntax compliance (cleaning up mandoc -Tlint nsh.8 output


b0b69440cc Stefan Sperling

make mantab.c compile without 'make obj'

The requirement to run 'make obj' before 'make' keeps getting in the way when nsh is compiled as part of the ports infrastructure.


52251c6854 Stefan Sperling

include stdio.h explicitly in utf8.c

extern.h depends on stdio.h because of FILENAME_MAX. wchar.h will stop pulling in stdio.h, hence break the build in utf8.c which will no longer pull in stdio.h. Patch by tb@


00166cee7f GitHub

use restricted less for pager for manual

Spotted and reported by sonic ... fixed by stspdotname (thanks ) "LESSSECURE=1" environment variable used to disable shell through less pager


dd8d34bfed Stefan Sperling

add sl_makestr() helper function

Written to support future rcctl support patches. ok chris


41d076f23c Stefan Sperling

ensure that window size information is always initialized

Fixes a divide-by-zero crash reported by sthen@. To reproduce: printf 'show\nshow run\n' > /tmp/nsh.script nsh -i /tmp/nsh.script ok chris


5a6c9083c6 Stefan Sperling

disable interactive mode if -c or -i options are used

ok chris


Branches

Tags

Tree

.gitignorecommits | blame
COPYRIGHTcommits | blame
Makefilecommits | blame
README.mdcommits | blame
arp.ccommits | blame
bgpcommands.ccommits | blame
bgpnsh/
bridge.ccommits | blame
bridge.hcommits | blame
carp.ccommits | blame
cmdargs.ccommits | blame
commands.ccommits | blame
commands.hcommits | blame
compile.shcommits | blame
complete.ccommits | blame
conf.ccommits | blame
ctl.ccommits | blame
ctl.hcommits | blame
ctlargs.ccommits | blame
editing.hcommits | blame
externs.hcommits | blame
genget.ccommits | blame
hashtable.ccommits | blame
helpcommands.ccommits | blame
ieee80211.ccommits | blame
if.ccommits | blame
ip.hcommits | blame
kroute.ccommits | blame
main.ccommits | blame
makeargv.ccommits | blame
mantab.sh*commits | blame
media.ccommits | blame
more.ccommits | blame
nameserver.ccommits | blame
ndp.ccommits | blame
nopt.ccommits | blame
nsh-dist.txtcommits | blame
nsh-version.mkcommits | blame
nsh.8commits | blame
nsh.rccommits | blame
nshdoas/
passwd.ccommits | blame
pflow.ccommits | blame
pfsync.ccommits | blame
ppp.ccommits | blame
prompt.ccommits | blame
route.ccommits | blame
save-ro.sh*commits | blame
save-rw.sh*commits | blame
scripts/
show.ccommits | blame
sqlite3.ccommits | blame
stats.ccommits | blame
stringlist.ccommits | blame
stringlist.hcommits | blame
sysctl.ccommits | blame
sysctl.hcommits | blame
trunk.ccommits | blame
tunnel.ccommits | blame
umb.ccommits | blame
utf8.ccommits | blame
utils.ccommits | blame
version.ccommits | blame
wg.ccommits | blame
who.ccommits | blame

README.md

# nsh 

## network shell

---
Chris Cappuccio <chris@nmedia.net>


NSH is a CLI intended for OpenBSD-based network appliances. It replaces
ifconfig, sysctl and route with its own simple command language, and
encapsulates configuration for other daemons into one place, effectively
replacing /etc/netstart and parts of /etc/rc for appliance-style usage.

## Daemons and services encapsulated by nsh:

bgpd, dhcpd, dhcpleased, dhcrelay, dvmrpd, eigrpd, ftp-proxy, ifstated, inetd, 
iked, ipsecctl, ldapd, ldpd, npppd, ntpd, ospfd, ospf6d, pf, rad, relayd, 
resolvd, ripd, sasyncd, slaacd, smtpd, snmpd, sshd, tftpd, tftp-proxy.

---

## License 

NSH is freely licensed, in the BSD style.

In conjunction with the OpenBSD kernel and the daemons you wish to control,
you have a fully functioning network appliance type of system.

---

## NSH Manual

See https://github.com/yellowman/nsh/wiki/NSH-Manual-page or 
nsh.8 manual for detailed installation instructions and command set.

See the to-do list on https://github.com/users/yellowman/projects/1 for 
details on implementation status and future ideas.

See http://github.com/yellowman/nsh/ for current source code repository.
See http://www.nmedia.net/nsh/ for example configurations and mailing
list.

See https://www.youtube.com/watch?v=WMKxIHaWaG0 for an EurobsdCon 2022 
Presentation on NSH for network administrators. 

---

## Quickstart Guide for installing and building **nsh** on an OpenBSD system

1. Install OpenBSD on your system 

2. Install the OpenBSD port of nsh on your system -(this will install the latest nsh release version)

```shell
pkg_add nsh  
```

3. Install git on your system to allow fetching more recent versions of nsh from github

```shell
pkg_add git
```

4. to download the latest development of nsh use git to download the latest nsh repository

```shell
git clone https://github.com/yellowman/nsh
```

5. change directory to the downloaded nsh directory 

```shell
cd nsh
```

6. to build the nsh sources follow the steps below

6a. make objects

```shell
make obj
```

6b. make / compile the sources

```shell
make
```

6c.  Install the compiled nsh binaries and supporting files (you will need root privileges to do this).

```shell
make install
```

7. To have nsh take over the configuration of a system a number of steps that need to be carried out such as


7a. Backup configuration of system, daemons and network in /etc 

7b. Copy the configuration files to /var/run/example-configfilename.0  (the .0 file extension) implies running in the default rdomain / rtable (rdomain 0)

7c. save the running config to /etc/nshrc

7d. secure the /etc/nshrc file so that world cannot read, write or execute it . 

7e. configure the system to run nsh -i /etc/nshrc  either adding a line to /etc/rc.local or using an rccctl script for nsh.

For the users convenience, the above steps can be largely automated by running  the **rc.local-nsh-openbsd-integration.sh** script and following on screen instructions.

```shell
cd scripts/
./rc.local-nsh-openbsd-integration.sh
```

8. once configuration has been imported, restart the system and verify nsh config is running as expected
   

10. please provide feedback , bug repots and suggestions to the developers on	our mailing list  <nsh@lists.deschutesdigital.com> .