User:Misterhaan/Ubuntu 22.10 Kinetic Kudu Setup: Difference between revisions

From auWiki
Jump to navigation Jump to search
(started setting up 22.10)
 
(openconnect (not letting me configure yet))
Line 8: Line 8:
# edit <code>/etc/hosts</code> as root with <code>sudo gedit /etc/hosts</code> and add a line mapping the lan ip of the server to its name.  follow the format of the line that has 127.0.0.1 localhost.  saving this change makes sure the laptop can resolve the name of the server, which sometimes doesn't work without this setting.
# edit <code>/etc/hosts</code> as root with <code>sudo gedit /etc/hosts</code> and add a line mapping the lan ip of the server to its name.  follow the format of the line that has 127.0.0.1 localhost.  saving this change makes sure the laptop can resolve the name of the server, which sometimes doesn't work without this setting.
# install nfs support with <code>sudo apt install nfs-common</code>
# install nfs support with <code>sudo apt install nfs-common</code>
# edit <code>/etc/fstab</code> as root with <code>sudo gedit /etc/fstab</code> and add a line for each nfs share to mount, in this format: <code>server:/nfs_share /local/mount/point nfs noexec 0 0</code>
# edit <code>/etc/fstab</code> as root with <code>sudo gedit /etc/fstab</code> and add a line for each nfs share to mount, in this format: <code>server:/nfs_share /local/mount/point nfs noexec,noauto 0 0</code>
# create the local mount points for each share (the second column in fstab) with a command like <code>sudo mkdir /local/mount/point</code>
# create the local mount points for each share (the second column in fstab) with a command like <code>sudo mkdir /local/mount/point</code>
# create a new file as root in <code>/etc/NetworkManager/dispatcher.d/</code> and enter the following code (make sure to put in your uuid and your actual mount points), then set its permissions to rwxr-xr-x with <code>chmod 755 /etc/NetworkManager/dispatcher.d/nfs-mount</code>:  
# create a new file as root in <code>/etc/NetworkManager/dispatcher.d/</code> and enter the following code (make sure to put in your uuid and your actual mount points), then set its permissions to rwxr-xr-x with <code>chmod 755 /etc/NetworkManager/dispatcher.d/nfs-mount</code>:  
Line 23: Line 23:
  fi
  fi


the network shares should be mounted whenever connecting to the wifi SSID.
the network shares should be mounted whenever connecting to the wifi SSID. the <code>noauto</code> in fstab tells the system not to attempt to mount those shares on startup, so it doesn't have to wait for that to fail when they're not available.  the NetworkManager script makes sure to mount them once connected to the correct wifi, but if you're going to connect to your network with a cable it's not going to do anything.
 
== remote control ==
remmina is in the default ubuntu install and works well to connect to my home desktop using vnc (i use tightvnc server on windows 11 there).  i create two connections for that -- one that uses my lan ip and another that uses the subdomain i keep mapped to my internet ip.  both use remmina vnc plugin for the protocol and specify [ip]:[port] or [subdomain]:[port] since i use a custom vnc port.  username can be left blank, and user password can save my connection password.  setting the password means if someone else got access to my laptop they could also access my desktop, so be sure to weigh the convenience against security for your situation.
 
== work vpn ==
my job provides cisco anyconnect vpn for me to connect remotely, but thankfully it's compatible with openconnect which is *much* easier to use and integrates with the network manager built into ubuntu.  install openconnect, its network manager integration, and its editor (gnome is the name of the desktop environment ubuntu uses, even for cinnamon):
 
sudo apt install openconnect network-manager-openconnect network-manager-openconnect-gnome
 
now go to settings > network and add a vpn connection (plus button in the lower right) using "Multi-protocol VPN client (openconnect)."  give it a name (i use the company name) and enter the vpn server as the gateway (something like vpn.example.com).  the vpn protocol should already be set to "cisco anyconnect or openconnect" from the earlier choice.
 
now, just under your wifi line in the system menu it should say "vpn off," which you can expand and choose connect.  the first time you do this it will prompt for username and password, which you can tell it to remember so it's even easier next time.  the window stays open for me until i confirm that it's me connecting through the authenticator app on my phone -- my only real problem with this system is that it doesn't tell me i need to do that if i'm only looking at my laptop . . . but i don't think anyconnect did either.
 
while connected, there's a vpn icon next to the wifi icon.  disconnect by expanding the name you gave to the vpn connection in the system menu and choosing "turn off."

Revision as of 11:10, 17 December 2022

i use ubuntu linux as my main operating system on my laptop. since the laptop came with windows 10 (which i upgraded to windows 11), i keep that around so i can choose windows on startup when i need one of the manufacturer's utilities.these instructions are what i did when i installed ubuntu cinnamon 22.10 kinetic kudu on my laptop westinghouse.

connections to other systems

most of what i use my laptop for is connecting to other systems, including my home file shares. i set those up first so i have access to my files and the ability to connect to my home desktop and work computer right away.

home server nfs shares

i have command-line ubuntu installed on a different computer at home that stores my files, so my laptop should mount its shares when i'm on my home network. i can't just do a normal mount because if i travel with my laptop, my home server isn't available and i have to wait for those connections to time out before it will finish booting. still, the first couple steps are the same as mounting the shares from a desktop:

  1. edit /etc/hosts as root with sudo gedit /etc/hosts and add a line mapping the lan ip of the server to its name. follow the format of the line that has 127.0.0.1 localhost. saving this change makes sure the laptop can resolve the name of the server, which sometimes doesn't work without this setting.
  2. install nfs support with sudo apt install nfs-common
  3. edit /etc/fstab as root with sudo gedit /etc/fstab and add a line for each nfs share to mount, in this format: server:/nfs_share /local/mount/point nfs noexec,noauto 0 0
  4. create the local mount points for each share (the second column in fstab) with a command like sudo mkdir /local/mount/point
  5. create a new file as root in /etc/NetworkManager/dispatcher.d/ and enter the following code (make sure to put in your uuid and your actual mount points), then set its permissions to rwxr-xr-x with chmod 755 /etc/NetworkManager/dispatcher.d/nfs-mount:
#!/bin/bash
SSID="your-wifi-ssid"
INTERFACE=$1
ACTION=$2
ESSID=`iwconfig $INTERFACE | grep ESSID | cut -d":" -f2 | sed 's/^[^"]*"\|"[^"]*$//g'`

if [ "$SSID" == "$ESSID" ] && [ "$ACTION" == "up" ]; then
	mount /local/mount/point/one
	mount /local/mount/point/two
fi

the network shares should be mounted whenever connecting to the wifi SSID. the noauto in fstab tells the system not to attempt to mount those shares on startup, so it doesn't have to wait for that to fail when they're not available. the NetworkManager script makes sure to mount them once connected to the correct wifi, but if you're going to connect to your network with a cable it's not going to do anything.

remote control

remmina is in the default ubuntu install and works well to connect to my home desktop using vnc (i use tightvnc server on windows 11 there). i create two connections for that -- one that uses my lan ip and another that uses the subdomain i keep mapped to my internet ip. both use remmina vnc plugin for the protocol and specify [ip]:[port] or [subdomain]:[port] since i use a custom vnc port. username can be left blank, and user password can save my connection password. setting the password means if someone else got access to my laptop they could also access my desktop, so be sure to weigh the convenience against security for your situation.

work vpn

my job provides cisco anyconnect vpn for me to connect remotely, but thankfully it's compatible with openconnect which is *much* easier to use and integrates with the network manager built into ubuntu. install openconnect, its network manager integration, and its editor (gnome is the name of the desktop environment ubuntu uses, even for cinnamon):

sudo apt install openconnect network-manager-openconnect network-manager-openconnect-gnome

now go to settings > network and add a vpn connection (plus button in the lower right) using "Multi-protocol VPN client (openconnect)." give it a name (i use the company name) and enter the vpn server as the gateway (something like vpn.example.com). the vpn protocol should already be set to "cisco anyconnect or openconnect" from the earlier choice.

now, just under your wifi line in the system menu it should say "vpn off," which you can expand and choose connect. the first time you do this it will prompt for username and password, which you can tell it to remember so it's even easier next time. the window stays open for me until i confirm that it's me connecting through the authenticator app on my phone -- my only real problem with this system is that it doesn't tell me i need to do that if i'm only looking at my laptop . . . but i don't think anyconnect did either.

while connected, there's a vpn icon next to the wifi icon. disconnect by expanding the name you gave to the vpn connection in the system menu and choosing "turn off."