1. Introduction
These are some devices running on my home network:
-
My second MacBook and cell phone.
-
My company’s laptop (Dell 3410).
-
My daughter’s MacBook and cell phone.
-
My wife’s laptop and cell phone.
-
My son’s laptop and cell phone.
So, in order to identify these devices on my network, I need a better way to name them. This document shows you how do I define the hostname for some of these devices. It also shows you the network configuration in some of them.
3. Hostnames
3.1. Name formation
-
The first two letters: device owner’s initials. Examples:
-
pj
: Paulo Jeronimo -
co
: Company (or Contractor)
-
-
The third letter: the device number (in Crockford’s Base32).
-
The fourth letter: device operational system. Examples:
-
a
: Android -
i
: iOS -
m
: macOS -
u
: Ubuntu -
w
: Windows
-
3.2. Virtualized machines (VMs)
VMs contains a dash (-
) in their hostname used as a separator for two
parts of the name.
The first part is the name of the host machine.
The second part is freely named but I usually name it containing at
least two characters:
-
First character: a letter identifying the operational system.
-
Second character: a digit in base32.
5. Network configuration
5.4. Ping from one host to another
pj@pj1m:~$ ping co0u.local PING co0u.local (192.168.15.14): 56 data bytes 64 bytes from 192.168.15.14: icmp_seq=0 ttl=64 time=3.858 ms 64 bytes from 192.168.15.14: icmp_seq=1 ttl=64 time=3.805 ms ^C
$ ssh co0u.local pj@co0u:~$ ping pj1m.local PING pj1m.local (192.168.15.6) 56(84) bytes of data. 64 bytes de 192.168.15.6 (192.168.15.6): icmp_seq=1 ttl=64 tempo=3.99 ms 64 bytes de 192.168.15.6 (192.168.15.6): icmp_seq=2 ttl=64 tempo=313 ms ^C
6. VNC connection (between pj1m and co0u)
6.1. pj1m → co0u
6.1.1. co0u steps
VNC packages installation:
$ sudo apt install tightvncserver xfce xfce-goodies
$ dpkg -l | grep vnc ii libvncclient1:amd64 0.9.12+dfsg-9ubuntu0.3 amd64 API to write one's own VNC server - client library ii remmina-plugin-vnc:amd64 1.4.2+dfsg-1ubuntu1 amd64 VNC plugin for Remmina ii tigervnc-common 1.10.1+dfsg-3 amd64 Virtual network computing; Common software needed by servers ii tigervnc-standalone-server 1.10.1+dfsg-3 amd64 Standalone virtual network computing server
VNC configuration:
$ mkdir -p ~/.vnc && cd $_
$ cat > xstartup.xfce4 <<'EOF' #!/bin/sh xrdb $HOME/.Xresources startxfce4 & EOF
$ ln -f xstartup.xfce4 xstartup
VNC start:
$ vncserver -geometry 1280x780 -depth 24 You will require a password to access your desktops. Password: Verify: Would you like to enter a view-only password (y/n)? n New 'co0u:1 (pj)' desktop at :1 on machine co0u Starting applications specified in /home/pj/.vnc/xstartup Log file is /home/pj/.vnc/co0u:1.log Use xtigervncviewer -SecurityTypes VncAuth -passwd /home/pj/.vnc/passwd :1 to connect to the VNC server.
You will be prompted to create a password. |
VNC execution verify:
$ ss -nlt | grep 5901 LISTEN 0 5 127.0.0.1:5901 0.0.0.0:* LISTEN 0 5 [::1]:5901 [::]:*
To stop the VNC server, type:
$ vncserver -kill :1
6.1.2. Connection to co0u
On pj1m
terminal, type:
$ ssh -L 59000:localhost:5901 -C -N -l pj co0u.local
# Type Ctrl+Z to get the shell again
$ # Put the ssh execution running in the background
$ bg
$ open vnc://localhost:59000
6.1.3. Troubleshooting
To XFCE starts a terminal, I needed to do this configuration (using a terminal already opened):
$ sudo update-alternatives --config x-terminal-emulator There are 2 choices for the alternative x-terminal-emulator (providing /usr/bin/x-terminal-emulator). Selection Path Priority Status ------------------------------------------------------------ * 0 /usr/bin/gnome-terminal.wrapper 40 auto mode 1 /usr/bin/gnome-terminal.wrapper 40 manual mode 2 /usr/bin/xfce4-terminal.wrapper 40 manual mode Press <enter> to keep the current choice[*], or type selection number: 2 update-alternatives: using /usr/bin/xfce4-terminal.wrapper to provide /usr/bin/x-terminal-emulator (x-terminal-emulator) in manual mode