This section explains how to create our nwatchcanada
service user account which will be dedicated strictly to running our nwapp-back
.
-
Create a services user for the application:
``` $ sudo groupadd --system nwatchcanada; $ sudo useradd --system --gid nwatchcanada --shell /bin/bash --home /opt/nwatchcanada nwatchcanada;
-
Create project home inside
/opt
:$ sudo mkdir /opt/nwatchcanada
-
Give the permissions to the
nwatchcanada
user:$ sudo chown nwatchcanada:nwatchcanada /opt/nwatchcanada
-
Go into our new user. Note:
sudo
is to elevate privilege andsu
to switch users.$ sudo su - nwatchcanada
-
Setup our go folders.
$ mkdir -p ~/go/{bin,pkg,src}
-
Open this file.
vi ~/.bash_profile
-
Append the following:
export GOROOT=/usr/local/go export GOBIN="$HOME/go/bin" export GOPATH="$HOME/go"
-
Apply your changes.
source /etc/profile && source ~/.bash_profile