<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://ocotal.iarc.uaf.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=172.20.235.108&amp;*</id>
	<title>IARC 207 Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://ocotal.iarc.uaf.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=172.20.235.108&amp;*"/>
	<link rel="alternate" type="text/html" href="http://ocotal.iarc.uaf.edu/index.php?title=Special:Contributions/172.20.235.108"/>
	<updated>2026-05-12T22:00:43Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.34.2</generator>
	<entry>
		<id>http://ocotal.iarc.uaf.edu/index.php?title=Initial_Debian_Server_Setup&amp;diff=2466</id>
		<title>Initial Debian Server Setup</title>
		<link rel="alternate" type="text/html" href="http://ocotal.iarc.uaf.edu/index.php?title=Initial_Debian_Server_Setup&amp;diff=2466"/>
		<updated>2018-07-19T23:02:33Z</updated>

		<summary type="html">&lt;p&gt;172.20.235.108: /* Install additional packages */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[IARC Server List]]&lt;br /&gt;
==Step by step (roughly) procedure for getting a Debian-ARM server up and running for remote deployment as a serial radio base or a number of other things==&lt;br /&gt;
Been meaning to put this together for a while.&lt;br /&gt;
===Download media===&lt;br /&gt;
A lot of these ARM based systems have a microSD or SD card image that can be flashed from an online source.  I like to use the most recent stable version of Debian if it's available and also the minimum size image so that less extra cruft is installed (don't need a window manager etc)&amp;lt;br&amp;gt;&lt;br /&gt;
The RaspberryPis work well, too but have less horsepower under the hood:&amp;lt;br&amp;gt;&lt;br /&gt;
https://www.raspberrypi.org/downloads/raspbian/&amp;lt;br&amp;gt;&lt;br /&gt;
This is more powerful but doesn't come with a vanilla kernel (this means long term updating is harder):&amp;lt;br&amp;gt;&lt;br /&gt;
http://wiki.solid-run.com/doku.php?id=products:imx6:overview:flashsdcard&lt;br /&gt;
&lt;br /&gt;
We also have a few units (the DreamPlug and the GuruPlug) from GlobalScale but the power supplies have become flaky over time and I think the cubox-i is current favorite.&amp;lt;br&amp;gt;&lt;br /&gt;
https://www.globalscaletechnologies.com/&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I guess in addition, also using intel based NUC which is slightly larger, maybe more powerful but the cpu instruction set is x86 rather than ARM.   For Debian, that means nothing but it should also mean we can run loggernet for linux further afield.  (this is on my later in the winter list).&lt;br /&gt;
&lt;br /&gt;
===First step===&lt;br /&gt;
#Download the current image of the OS available online to your computer&lt;br /&gt;
## http://wiki.solid-run.com/doku.php?id=products:imx6:software:os:debian&amp;lt;br&amp;gt;&lt;br /&gt;
## https://www.raspberrypi.org/downloads/raspbian/&amp;lt;br&amp;gt;&lt;br /&gt;
# Flash it to the appropriate media (microSD or SD card typically).  Something like this:&lt;br /&gt;
## sudo dd if=~/Downloads/ignition.img of=/dev/rdisk2 bs=4096 ''' (cubox-i example)'''&lt;br /&gt;
## sudo dd if=2015-11-21-raspbian-jessie-lite.img of=/dev/rdisk2 bs=4096 '''(Raspberry Pi example)'''&lt;br /&gt;
# Look up online the default user / password to get into the system once it is up and running, too.  &lt;br /&gt;
## A simple search for something like &amp;quot;''Raspberry pi default user name and password''&amp;quot; should get you close.&lt;br /&gt;
# Once you're up and running, log in as the default user and then let's do some set up in an interactive sudo session:&lt;br /&gt;
&amp;lt;pre&amp;gt; sudo -i&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===For raspberry pi, change keyboard layout to US===&lt;br /&gt;
Default is UK English layout... before you change the passwords you should get a US layout keyboard. Here is a good resource&amp;lt;br&amp;gt;&lt;br /&gt;
https://wiki.debian.org/Keyboard&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;dpkg-reconfigure keyboard-configuration&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt; service keyboard-setup restart&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Create user accounts===&lt;br /&gt;
(junk name here not what you might see on our systems)&lt;br /&gt;
&amp;lt;pre&amp;gt; adduser scientist&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== give the user extended permissions===&lt;br /&gt;
https://wiki.debian.org/sudo&lt;br /&gt;
&amp;lt;pre&amp;gt;adduser scientist sudo&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Tighten up remote ssh access===&lt;br /&gt;
Been having some issues with port scanning and automated log in attempts from all over the world.  You can initially lock things down by disabling the default account from ssh login (after creating your first other user in the previous step).  First up, edit the ssh server configuration.  The file is found in ''/etc/ssh/sshd_config'':&lt;br /&gt;
&amp;lt;pre&amp;gt; editor /etc/ssh/sshd_config&amp;lt;/pre&amp;gt;&lt;br /&gt;
Add these lines to that file (or verify that they are there / double check that you aren't duplicating and creating confusion for the daemon):&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
## Disable root login:&lt;br /&gt;
PermitRootLogin no&lt;br /&gt;
##specify which users can log in over ssh:&lt;br /&gt;
AllowUsers scientist&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
With that out of the way, restart the ssh server and you have taken a step towards better securing the system:&lt;br /&gt;
&amp;lt;pre&amp;gt;service ssh restart&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Update Firewall:===&lt;br /&gt;
Firewall is complicated.  I'm not 100% I have this correct but it's quite a bit more secure than the defaults and such.  It's worth its own entry though:&lt;br /&gt;
* [[IP Tables Firewall Example]]&lt;br /&gt;
&lt;br /&gt;
===update apt &amp;amp; all packages===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt-get update&lt;br /&gt;
apt-get upgrade&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Raspberry Pi specific: Resize Partition===&lt;br /&gt;
Run this utility as root:&lt;br /&gt;
&amp;lt;pre&amp;gt;raspi-config&amp;lt;/pre&amp;gt;&lt;br /&gt;
One of the options (the first one) is:&lt;br /&gt;
&amp;lt;pre&amp;gt;1 Expand Filesystem            Ensures that all of the SD card storage is available to the OS  &amp;lt;/pre&amp;gt;&lt;br /&gt;
Select that and the file system will go from the default, like 1.3 GB and expand to consume the whole card.  See here for a bit more discussion:&amp;lt;br&amp;gt;&lt;br /&gt;
http://raspberrypi.stackexchange.com/questions/499/how-can-i-resize-my-root-partition&lt;br /&gt;
&lt;br /&gt;
===Install additional packages===&lt;br /&gt;
Great, if you've made it this far then you should have a decently secure system, nearly ready for deployment.  There are a few more pacakges it is smart to install...  kind of depends on what you are doing whether you add all of them or not but there first are a good move.&lt;br /&gt;
&lt;br /&gt;
 apt-get install nmap ntp less imagemagick python mailutils fail2ban ser2net git telnet screen wget curl xdg zip net-tools&lt;br /&gt;
* '''nmap''' is useful for checking out the internet presence of your device.  Kind of optional but nice to have installed if you need it at a later date.&lt;br /&gt;
** https://packages.debian.org/stable/nmap&lt;br /&gt;
* '''ntp''' is the time server, used to get internet time.  It should be installed by default but I have found it isn't alway.  So, best to be explicit and install it here.&lt;br /&gt;
** https://packages.debian.org/jessie/ntp&lt;br /&gt;
* '''less'''  is a simple command line utility for reading text files. A gain, it should be installed by default but I have run into it not being installed.&lt;br /&gt;
** https://packages.debian.org/jessie/less&lt;br /&gt;
* '''imagemagick''' is a great command line based image manipulation library.  Used by a few different utilities. I think we use it to resize / slice automatically generated plots, and to do some other stuff in Barrow.&lt;br /&gt;
** https://packages.debian.org/jessie/imagemagick&lt;br /&gt;
* '''python''' common programming language we use extensively and should be added to the system.&lt;br /&gt;
* '''mailutils''' is a simple email package.  Used by crontab &amp;amp; the security updates system (as well as others I'm forgetting) to give you status information.&lt;br /&gt;
* '''fail2ban''' is used to lockdown ssh a bit further than the default ip tables rules.  It blocks IP addresses that try to log in too often with a bad user/password.  Intended to reduce workload of these simple computers handling garbage so they can focus on serving as a serial base station etc.&lt;br /&gt;
* '''ser2net''' pretty solid utility for getting serial port access (or usb to serial access) via sockets. This is the primary thing we use to handle getting data logger information available over the internet.  For multipoint radios, there is also a '''ser2nets''' which can allow more than one LoggerNet instance to access the radio network simultaneously.  I haven't used ser2nets but have thought about experimenting with it.&lt;br /&gt;
* '''git'''  we use this for distributing datapro and other utilities&lt;br /&gt;
* ''telnet'' useful for testing ser2net's operation.&lt;br /&gt;
* ''screen'' useful for testing the usb to serial device&lt;br /&gt;
* ''curl'' utility for grabbing web pages / data from servers&lt;br /&gt;
* ''wget'' utility for grabbing web pages / data from servers&lt;br /&gt;
&lt;br /&gt;
====Automatically install security updates:====&lt;br /&gt;
The last generally mandatory package to add is the Unattended security updates.  There are couple packages to install but there are also some configs to modify It's best to just read this page. &amp;lt;br&amp;gt;&lt;br /&gt;
https://wiki.debian.org/UnattendedUpgrades&amp;lt;br&amp;gt;&lt;br /&gt;
But, I can also give you a hint that you'll need to do at least these three things from the command line:&lt;br /&gt;
&amp;lt;pre&amp;gt;apt-get install unattended-upgrades apt-listchanges&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;editor /etc/apt/apt.conf.d/50unattended-upgrades&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;editor /etc/apt/apt.conf.d/20auto-upgrades&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Other packages===&lt;br /&gt;
So, those are typically the base to get you up and running.  Then, this next set are slightly more specialized.  If you are going to do any data processing or use the WERC data retrieval tools these are good to install:&lt;br /&gt;
 apt-get install build-essential libdbi-perl libconfig-yaml-perl python-numpy python-tz python-pandas liblockfile-simple-perl libdbi-perl bc&lt;br /&gt;
 apt-get install python-gdal python-xlrd python-scipy autossh&lt;br /&gt;
&lt;br /&gt;
===check timezone===&lt;br /&gt;
Important to confirm we are using UTC:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dpkg-reconfigure tzdata &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Next steps===&lt;br /&gt;
So, at this point you have a system that has now been tailored to generic deployment.  With that out of the way there are some specific things and tools / scripts that are nice to give you a bit more feedback. For example. it needs to tell you its IP address routinely so there are some things to set up in order to make that happen like:&lt;br /&gt;
* set up a private key in the ''scientist'' user account so you can automate the transfer&lt;br /&gt;
** follow this: http://troy.jdmz.net/rsync/index.html&lt;br /&gt;
**  '''ssh-keygen -t rsa -b 2048 '''&lt;br /&gt;
** then, add the key to the server you want to push too:&lt;br /&gt;
*** '''ssh-copy-id scientist@ngeedata.iarc.uaf.edu'''&lt;br /&gt;
* set up the crontab so that the automated stuff is configured to happen... do all of this from your user account rather than your root account.&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
mkdir ~/bin&lt;br /&gt;
nano ~/bin/main_cron&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* add something like this to the file main_cron to transmit the IP address every 10 minutes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
*/10 * * * * /sbin/ifconfig &amp;gt; /home/scientist/grayling_ip.txt&lt;br /&gt;
*/10 * * * * scp -oport=2222 /home/scientist/grayling_ip.txt user@ngeedata.iarc.uaf.edu:/home/user/remote_ips/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* add this to the crontab:&lt;br /&gt;
&amp;lt;pre&amp;gt; crontab ~/bin/main_cron&amp;lt;/pre&amp;gt;&lt;br /&gt;
* confirm that it is in the crontab:&lt;br /&gt;
&amp;lt;pre&amp;gt; crontab -l&amp;lt;/pre&amp;gt;&lt;br /&gt;
Great, &lt;br /&gt;
* set up a few more bash scripts... running out of steam here I'm just going to list commands for a bit and then annotate later.&lt;br /&gt;
* this gets Ross' csv utilities with datapro plus a number of other things installed&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~/bin/&lt;br /&gt;
git clone https://github.com/rwspicer/csv_utilities.git&lt;br /&gt;
python ~/bin/csv_utilities/get_ip.py --infile=/home/scientist/extra/grayling_ip.txt --outfile=/home/scientist/grayling_ip&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* also need to configure ser2net:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo nano /etc/ser2net.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
* remove the existing lines at the bottom of the configuration and add this:&lt;br /&gt;
** specifying the port as ''7808''&lt;br /&gt;
** data type is '''''raw''''' ''(default is telnet)''&lt;br /&gt;
** serial to usb device is ''/dev/ttyUSB0''&lt;br /&gt;
** speed and data information (this is standard of most of our serial things though the baud rate may change depending on application): ''115200 8DATABITS NONE 1STOPBIT''&lt;br /&gt;
** a few additional parameters to close the connection and reset the radio after each use: '' HANGUP_WHEN_DONE RTSCTS LOCAL''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# IARC radio&lt;br /&gt;
7808:raw:25:/dev/ttyUSB0:115200 8DATABITS NONE 1STOPBIT HANGUP_WHEN_DONE RTSCTS LOCAL&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* now, reload ser2net daemon with new configuration:&lt;br /&gt;
&amp;lt;pre&amp;gt;service ser2net restart&amp;lt;/pre&amp;gt;&lt;br /&gt;
* next, test your setup:&lt;br /&gt;
&amp;lt;pre&amp;gt; telnet localhost 7808&amp;lt;/pre&amp;gt;&lt;br /&gt;
** then hit enter a bunch and watch for a reply from the data logger.  If you see it, awesome. to close the program, hold down the control key and press the close bracket key.  This will bring up a new prompt:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;CONTROL&amp;gt;&amp;lt;]&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
** then:&lt;br /&gt;
&amp;lt;pre&amp;gt;close&amp;lt;/pre&amp;gt;&lt;br /&gt;
* if that works, fantastic.  If that doesn't, try connecting directly to the serial port using ''screen'':&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo screen /dev/ttyUSB0 9600&amp;lt;/pre&amp;gt;&lt;br /&gt;
** If that works, awesome!  To quit screen then enter:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;CONTROL&amp;gt; - &amp;lt;A&amp;gt;  (press and hold control, then press A)&lt;br /&gt;
&amp;lt;COLON&amp;gt;&lt;br /&gt;
&amp;lt;TYPE&amp;gt; quit &amp;lt;/TYPE&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* if that works, then you have a good serial connection and may just need to tweak the ser2net configuration.&lt;br /&gt;
** I just noticed here that &amp;lt;pre&amp;gt;service ser2net restart&amp;lt;/pre&amp;gt; didn't properly reload the configuration file.  However this did:&lt;br /&gt;
&amp;lt;pre&amp;gt;service ser2net stop&lt;br /&gt;
service ser2net start&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Yet to come===&lt;br /&gt;
So, at this point you have a solid serial server.  There is often more functionality you can add though depending on how things go.  For instance, the speed test bash script may need to be installed, there might be webcam&lt;br /&gt;
===Intel Nucs===&lt;br /&gt;
====BIOS Fixes====&lt;br /&gt;
* Power screen&lt;br /&gt;
** Secondary Power Settings:&lt;br /&gt;
*** After Power failure Power On&lt;br /&gt;
*** Wake System from S5&lt;br /&gt;
*****Wake daily &lt;br /&gt;
* Boot&lt;br /&gt;
** Boot Configureation&lt;br /&gt;
*** UEFI Boot OS Selection Linux&lt;br /&gt;
** Secure Boot&lt;br /&gt;
*** Secure Boot Disabled&lt;br /&gt;
* Devices and Peripherals&lt;br /&gt;
** Onboard Devices&lt;br /&gt;
*** Audio Disabled&lt;br /&gt;
*** HD-Audio Disabled&lt;br /&gt;
*** Microphone Disabled&lt;br /&gt;
*** WLAN Disabled&lt;br /&gt;
*** Bluetooth Disabled&lt;br /&gt;
** Legacy Device Configuration&lt;br /&gt;
*** Enhanced Consumer IR Disabled&lt;br /&gt;
*** HDMI CEC Control Disabled&lt;br /&gt;
===After Debian Install Fixes===&lt;br /&gt;
* Enable non-free in /etc/apt/sources.list&lt;br /&gt;
* install closed source firmware:&lt;br /&gt;
 apt-get install firmware-realtek&lt;/div&gt;</summary>
		<author><name>172.20.235.108</name></author>
		
	</entry>
	<entry>
		<id>http://ocotal.iarc.uaf.edu/index.php?title=Initial_Debian_Server_Setup&amp;diff=2465</id>
		<title>Initial Debian Server Setup</title>
		<link rel="alternate" type="text/html" href="http://ocotal.iarc.uaf.edu/index.php?title=Initial_Debian_Server_Setup&amp;diff=2465"/>
		<updated>2018-07-19T22:22:07Z</updated>

		<summary type="html">&lt;p&gt;172.20.235.108: /* Install additional packages */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[IARC Server List]]&lt;br /&gt;
==Step by step (roughly) procedure for getting a Debian-ARM server up and running for remote deployment as a serial radio base or a number of other things==&lt;br /&gt;
Been meaning to put this together for a while.&lt;br /&gt;
===Download media===&lt;br /&gt;
A lot of these ARM based systems have a microSD or SD card image that can be flashed from an online source.  I like to use the most recent stable version of Debian if it's available and also the minimum size image so that less extra cruft is installed (don't need a window manager etc)&amp;lt;br&amp;gt;&lt;br /&gt;
The RaspberryPis work well, too but have less horsepower under the hood:&amp;lt;br&amp;gt;&lt;br /&gt;
https://www.raspberrypi.org/downloads/raspbian/&amp;lt;br&amp;gt;&lt;br /&gt;
This is more powerful but doesn't come with a vanilla kernel (this means long term updating is harder):&amp;lt;br&amp;gt;&lt;br /&gt;
http://wiki.solid-run.com/doku.php?id=products:imx6:overview:flashsdcard&lt;br /&gt;
&lt;br /&gt;
We also have a few units (the DreamPlug and the GuruPlug) from GlobalScale but the power supplies have become flaky over time and I think the cubox-i is current favorite.&amp;lt;br&amp;gt;&lt;br /&gt;
https://www.globalscaletechnologies.com/&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I guess in addition, also using intel based NUC which is slightly larger, maybe more powerful but the cpu instruction set is x86 rather than ARM.   For Debian, that means nothing but it should also mean we can run loggernet for linux further afield.  (this is on my later in the winter list).&lt;br /&gt;
&lt;br /&gt;
===First step===&lt;br /&gt;
#Download the current image of the OS available online to your computer&lt;br /&gt;
## http://wiki.solid-run.com/doku.php?id=products:imx6:software:os:debian&amp;lt;br&amp;gt;&lt;br /&gt;
## https://www.raspberrypi.org/downloads/raspbian/&amp;lt;br&amp;gt;&lt;br /&gt;
# Flash it to the appropriate media (microSD or SD card typically).  Something like this:&lt;br /&gt;
## sudo dd if=~/Downloads/ignition.img of=/dev/rdisk2 bs=4096 ''' (cubox-i example)'''&lt;br /&gt;
## sudo dd if=2015-11-21-raspbian-jessie-lite.img of=/dev/rdisk2 bs=4096 '''(Raspberry Pi example)'''&lt;br /&gt;
# Look up online the default user / password to get into the system once it is up and running, too.  &lt;br /&gt;
## A simple search for something like &amp;quot;''Raspberry pi default user name and password''&amp;quot; should get you close.&lt;br /&gt;
# Once you're up and running, log in as the default user and then let's do some set up in an interactive sudo session:&lt;br /&gt;
&amp;lt;pre&amp;gt; sudo -i&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===For raspberry pi, change keyboard layout to US===&lt;br /&gt;
Default is UK English layout... before you change the passwords you should get a US layout keyboard. Here is a good resource&amp;lt;br&amp;gt;&lt;br /&gt;
https://wiki.debian.org/Keyboard&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;dpkg-reconfigure keyboard-configuration&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt; service keyboard-setup restart&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Create user accounts===&lt;br /&gt;
(junk name here not what you might see on our systems)&lt;br /&gt;
&amp;lt;pre&amp;gt; adduser scientist&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== give the user extended permissions===&lt;br /&gt;
https://wiki.debian.org/sudo&lt;br /&gt;
&amp;lt;pre&amp;gt;adduser scientist sudo&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Tighten up remote ssh access===&lt;br /&gt;
Been having some issues with port scanning and automated log in attempts from all over the world.  You can initially lock things down by disabling the default account from ssh login (after creating your first other user in the previous step).  First up, edit the ssh server configuration.  The file is found in ''/etc/ssh/sshd_config'':&lt;br /&gt;
&amp;lt;pre&amp;gt; editor /etc/ssh/sshd_config&amp;lt;/pre&amp;gt;&lt;br /&gt;
Add these lines to that file (or verify that they are there / double check that you aren't duplicating and creating confusion for the daemon):&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
## Disable root login:&lt;br /&gt;
PermitRootLogin no&lt;br /&gt;
##specify which users can log in over ssh:&lt;br /&gt;
AllowUsers scientist&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
With that out of the way, restart the ssh server and you have taken a step towards better securing the system:&lt;br /&gt;
&amp;lt;pre&amp;gt;service ssh restart&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Update Firewall:===&lt;br /&gt;
Firewall is complicated.  I'm not 100% I have this correct but it's quite a bit more secure than the defaults and such.  It's worth its own entry though:&lt;br /&gt;
* [[IP Tables Firewall Example]]&lt;br /&gt;
&lt;br /&gt;
===update apt &amp;amp; all packages===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt-get update&lt;br /&gt;
apt-get upgrade&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Raspberry Pi specific: Resize Partition===&lt;br /&gt;
Run this utility as root:&lt;br /&gt;
&amp;lt;pre&amp;gt;raspi-config&amp;lt;/pre&amp;gt;&lt;br /&gt;
One of the options (the first one) is:&lt;br /&gt;
&amp;lt;pre&amp;gt;1 Expand Filesystem            Ensures that all of the SD card storage is available to the OS  &amp;lt;/pre&amp;gt;&lt;br /&gt;
Select that and the file system will go from the default, like 1.3 GB and expand to consume the whole card.  See here for a bit more discussion:&amp;lt;br&amp;gt;&lt;br /&gt;
http://raspberrypi.stackexchange.com/questions/499/how-can-i-resize-my-root-partition&lt;br /&gt;
&lt;br /&gt;
===Install additional packages===&lt;br /&gt;
Great, if you've made it this far then you should have a decently secure system, nearly ready for deployment.  There are a few more pacakges it is smart to install...  kind of depends on what you are doing whether you add all of them or not but there first are a good move.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; apt-get install nmap ntp less imagemagick python mailutils fail2ban ser2net git telnet screen wget curl xdg zip&amp;lt;/pre&amp;gt;&lt;br /&gt;
* '''nmap''' is useful for checking out the internet presence of your device.  Kind of optional but nice to have installed if you need it at a later date.&lt;br /&gt;
** https://packages.debian.org/stable/nmap&lt;br /&gt;
* '''ntp''' is the time server, used to get internet time.  It should be installed by default but I have found it isn't alway.  So, best to be explicit and install it here.&lt;br /&gt;
** https://packages.debian.org/jessie/ntp&lt;br /&gt;
* '''less'''  is a simple command line utility for reading text files. A gain, it should be installed by default but I have run into it not being installed.&lt;br /&gt;
** https://packages.debian.org/jessie/less&lt;br /&gt;
* '''imagemagick''' is a great command line based image manipulation library.  Used by a few different utilities. I think we use it to resize / slice automatically generated plots, and to do some other stuff in Barrow.&lt;br /&gt;
** https://packages.debian.org/jessie/imagemagick&lt;br /&gt;
* '''python''' common programming language we use extensively and should be added to the system.&lt;br /&gt;
* '''mailutils''' is a simple email package.  Used by crontab &amp;amp; the security updates system (as well as others I'm forgetting) to give you status information.&lt;br /&gt;
* '''fail2ban''' is used to lockdown ssh a bit further than the default ip tables rules.  It blocks IP addresses that try to log in too often with a bad user/password.  Intended to reduce workload of these simple computers handling garbage so they can focus on serving as a serial base station etc.&lt;br /&gt;
* '''ser2net''' pretty solid utility for getting serial port access (or usb to serial access) via sockets. This is the primary thing we use to handle getting data logger information available over the internet.  For multipoint radios, there is also a '''ser2nets''' which can allow more than one LoggerNet instance to access the radio network simultaneously.  I haven't used ser2nets but have thought about experimenting with it.&lt;br /&gt;
* '''git'''  we use this for distributing datapro and other utilities&lt;br /&gt;
* ''telnet'' useful for testing ser2net's operation.&lt;br /&gt;
* ''screen'' useful for testing the usb to serial device&lt;br /&gt;
* ''curl'' utility for grabbing web pages / data from servers&lt;br /&gt;
* ''wget'' utility for grabbing web pages / data from servers&lt;br /&gt;
&lt;br /&gt;
====Automatically install security updates:====&lt;br /&gt;
The last generally mandatory package to add is the Unattended security updates.  There are couple packages to install but there are also some configs to modify It's best to just read this page. &amp;lt;br&amp;gt;&lt;br /&gt;
https://wiki.debian.org/UnattendedUpgrades&amp;lt;br&amp;gt;&lt;br /&gt;
But, I can also give you a hint that you'll need to do at least these three things from the command line:&lt;br /&gt;
&amp;lt;pre&amp;gt;apt-get install unattended-upgrades apt-listchanges&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;editor /etc/apt/apt.conf.d/50unattended-upgrades&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;editor /etc/apt/apt.conf.d/20auto-upgrades&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Other packages===&lt;br /&gt;
So, those are typically the base to get you up and running.  Then, this next set are slightly more specialized.  If you are going to do any data processing or use the WERC data retrieval tools these are good to install:&lt;br /&gt;
 apt-get install build-essential libdbi-perl libconfig-yaml-perl python-numpy python-tz python-pandas liblockfile-simple-perl libdbi-perl bc&lt;br /&gt;
 apt-get install python-gdal python-xlrd python-scipy autossh&lt;br /&gt;
&lt;br /&gt;
===check timezone===&lt;br /&gt;
Important to confirm we are using UTC:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dpkg-reconfigure tzdata &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Next steps===&lt;br /&gt;
So, at this point you have a system that has now been tailored to generic deployment.  With that out of the way there are some specific things and tools / scripts that are nice to give you a bit more feedback. For example. it needs to tell you its IP address routinely so there are some things to set up in order to make that happen like:&lt;br /&gt;
* set up a private key in the ''scientist'' user account so you can automate the transfer&lt;br /&gt;
** follow this: http://troy.jdmz.net/rsync/index.html&lt;br /&gt;
**  '''ssh-keygen -t rsa -b 2048 '''&lt;br /&gt;
** then, add the key to the server you want to push too:&lt;br /&gt;
*** '''ssh-copy-id scientist@ngeedata.iarc.uaf.edu'''&lt;br /&gt;
* set up the crontab so that the automated stuff is configured to happen... do all of this from your user account rather than your root account.&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
mkdir ~/bin&lt;br /&gt;
nano ~/bin/main_cron&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* add something like this to the file main_cron to transmit the IP address every 10 minutes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
*/10 * * * * /sbin/ifconfig &amp;gt; /home/scientist/grayling_ip.txt&lt;br /&gt;
*/10 * * * * scp -oport=2222 /home/scientist/grayling_ip.txt user@ngeedata.iarc.uaf.edu:/home/user/remote_ips/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* add this to the crontab:&lt;br /&gt;
&amp;lt;pre&amp;gt; crontab ~/bin/main_cron&amp;lt;/pre&amp;gt;&lt;br /&gt;
* confirm that it is in the crontab:&lt;br /&gt;
&amp;lt;pre&amp;gt; crontab -l&amp;lt;/pre&amp;gt;&lt;br /&gt;
Great, &lt;br /&gt;
* set up a few more bash scripts... running out of steam here I'm just going to list commands for a bit and then annotate later.&lt;br /&gt;
* this gets Ross' csv utilities with datapro plus a number of other things installed&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~/bin/&lt;br /&gt;
git clone https://github.com/rwspicer/csv_utilities.git&lt;br /&gt;
python ~/bin/csv_utilities/get_ip.py --infile=/home/scientist/extra/grayling_ip.txt --outfile=/home/scientist/grayling_ip&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* also need to configure ser2net:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo nano /etc/ser2net.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
* remove the existing lines at the bottom of the configuration and add this:&lt;br /&gt;
** specifying the port as ''7808''&lt;br /&gt;
** data type is '''''raw''''' ''(default is telnet)''&lt;br /&gt;
** serial to usb device is ''/dev/ttyUSB0''&lt;br /&gt;
** speed and data information (this is standard of most of our serial things though the baud rate may change depending on application): ''115200 8DATABITS NONE 1STOPBIT''&lt;br /&gt;
** a few additional parameters to close the connection and reset the radio after each use: '' HANGUP_WHEN_DONE RTSCTS LOCAL''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# IARC radio&lt;br /&gt;
7808:raw:25:/dev/ttyUSB0:115200 8DATABITS NONE 1STOPBIT HANGUP_WHEN_DONE RTSCTS LOCAL&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* now, reload ser2net daemon with new configuration:&lt;br /&gt;
&amp;lt;pre&amp;gt;service ser2net restart&amp;lt;/pre&amp;gt;&lt;br /&gt;
* next, test your setup:&lt;br /&gt;
&amp;lt;pre&amp;gt; telnet localhost 7808&amp;lt;/pre&amp;gt;&lt;br /&gt;
** then hit enter a bunch and watch for a reply from the data logger.  If you see it, awesome. to close the program, hold down the control key and press the close bracket key.  This will bring up a new prompt:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;CONTROL&amp;gt;&amp;lt;]&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
** then:&lt;br /&gt;
&amp;lt;pre&amp;gt;close&amp;lt;/pre&amp;gt;&lt;br /&gt;
* if that works, fantastic.  If that doesn't, try connecting directly to the serial port using ''screen'':&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo screen /dev/ttyUSB0 9600&amp;lt;/pre&amp;gt;&lt;br /&gt;
** If that works, awesome!  To quit screen then enter:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;CONTROL&amp;gt; - &amp;lt;A&amp;gt;  (press and hold control, then press A)&lt;br /&gt;
&amp;lt;COLON&amp;gt;&lt;br /&gt;
&amp;lt;TYPE&amp;gt; quit &amp;lt;/TYPE&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* if that works, then you have a good serial connection and may just need to tweak the ser2net configuration.&lt;br /&gt;
** I just noticed here that &amp;lt;pre&amp;gt;service ser2net restart&amp;lt;/pre&amp;gt; didn't properly reload the configuration file.  However this did:&lt;br /&gt;
&amp;lt;pre&amp;gt;service ser2net stop&lt;br /&gt;
service ser2net start&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Yet to come===&lt;br /&gt;
So, at this point you have a solid serial server.  There is often more functionality you can add though depending on how things go.  For instance, the speed test bash script may need to be installed, there might be webcam&lt;br /&gt;
===Intel Nucs===&lt;br /&gt;
====BIOS Fixes====&lt;br /&gt;
* Power screen&lt;br /&gt;
** Secondary Power Settings:&lt;br /&gt;
*** After Power failure Power On&lt;br /&gt;
*** Wake System from S5&lt;br /&gt;
*****Wake daily &lt;br /&gt;
* Boot&lt;br /&gt;
** Boot Configureation&lt;br /&gt;
*** UEFI Boot OS Selection Linux&lt;br /&gt;
** Secure Boot&lt;br /&gt;
*** Secure Boot Disabled&lt;br /&gt;
* Devices and Peripherals&lt;br /&gt;
** Onboard Devices&lt;br /&gt;
*** Audio Disabled&lt;br /&gt;
*** HD-Audio Disabled&lt;br /&gt;
*** Microphone Disabled&lt;br /&gt;
*** WLAN Disabled&lt;br /&gt;
*** Bluetooth Disabled&lt;br /&gt;
** Legacy Device Configuration&lt;br /&gt;
*** Enhanced Consumer IR Disabled&lt;br /&gt;
*** HDMI CEC Control Disabled&lt;br /&gt;
===After Debian Install Fixes===&lt;br /&gt;
* Enable non-free in /etc/apt/sources.list&lt;br /&gt;
* install closed source firmware:&lt;br /&gt;
 apt-get install firmware-realtek&lt;/div&gt;</summary>
		<author><name>172.20.235.108</name></author>
		
	</entry>
	<entry>
		<id>http://ocotal.iarc.uaf.edu/index.php?title=Initial_Debian_Server_Setup&amp;diff=2464</id>
		<title>Initial Debian Server Setup</title>
		<link rel="alternate" type="text/html" href="http://ocotal.iarc.uaf.edu/index.php?title=Initial_Debian_Server_Setup&amp;diff=2464"/>
		<updated>2018-07-19T22:08:30Z</updated>

		<summary type="html">&lt;p&gt;172.20.235.108: /* Other packages */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[IARC Server List]]&lt;br /&gt;
==Step by step (roughly) procedure for getting a Debian-ARM server up and running for remote deployment as a serial radio base or a number of other things==&lt;br /&gt;
Been meaning to put this together for a while.&lt;br /&gt;
===Download media===&lt;br /&gt;
A lot of these ARM based systems have a microSD or SD card image that can be flashed from an online source.  I like to use the most recent stable version of Debian if it's available and also the minimum size image so that less extra cruft is installed (don't need a window manager etc)&amp;lt;br&amp;gt;&lt;br /&gt;
The RaspberryPis work well, too but have less horsepower under the hood:&amp;lt;br&amp;gt;&lt;br /&gt;
https://www.raspberrypi.org/downloads/raspbian/&amp;lt;br&amp;gt;&lt;br /&gt;
This is more powerful but doesn't come with a vanilla kernel (this means long term updating is harder):&amp;lt;br&amp;gt;&lt;br /&gt;
http://wiki.solid-run.com/doku.php?id=products:imx6:overview:flashsdcard&lt;br /&gt;
&lt;br /&gt;
We also have a few units (the DreamPlug and the GuruPlug) from GlobalScale but the power supplies have become flaky over time and I think the cubox-i is current favorite.&amp;lt;br&amp;gt;&lt;br /&gt;
https://www.globalscaletechnologies.com/&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I guess in addition, also using intel based NUC which is slightly larger, maybe more powerful but the cpu instruction set is x86 rather than ARM.   For Debian, that means nothing but it should also mean we can run loggernet for linux further afield.  (this is on my later in the winter list).&lt;br /&gt;
&lt;br /&gt;
===First step===&lt;br /&gt;
#Download the current image of the OS available online to your computer&lt;br /&gt;
## http://wiki.solid-run.com/doku.php?id=products:imx6:software:os:debian&amp;lt;br&amp;gt;&lt;br /&gt;
## https://www.raspberrypi.org/downloads/raspbian/&amp;lt;br&amp;gt;&lt;br /&gt;
# Flash it to the appropriate media (microSD or SD card typically).  Something like this:&lt;br /&gt;
## sudo dd if=~/Downloads/ignition.img of=/dev/rdisk2 bs=4096 ''' (cubox-i example)'''&lt;br /&gt;
## sudo dd if=2015-11-21-raspbian-jessie-lite.img of=/dev/rdisk2 bs=4096 '''(Raspberry Pi example)'''&lt;br /&gt;
# Look up online the default user / password to get into the system once it is up and running, too.  &lt;br /&gt;
## A simple search for something like &amp;quot;''Raspberry pi default user name and password''&amp;quot; should get you close.&lt;br /&gt;
# Once you're up and running, log in as the default user and then let's do some set up in an interactive sudo session:&lt;br /&gt;
&amp;lt;pre&amp;gt; sudo -i&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===For raspberry pi, change keyboard layout to US===&lt;br /&gt;
Default is UK English layout... before you change the passwords you should get a US layout keyboard. Here is a good resource&amp;lt;br&amp;gt;&lt;br /&gt;
https://wiki.debian.org/Keyboard&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;dpkg-reconfigure keyboard-configuration&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt; service keyboard-setup restart&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Create user accounts===&lt;br /&gt;
(junk name here not what you might see on our systems)&lt;br /&gt;
&amp;lt;pre&amp;gt; adduser scientist&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== give the user extended permissions===&lt;br /&gt;
https://wiki.debian.org/sudo&lt;br /&gt;
&amp;lt;pre&amp;gt;adduser scientist sudo&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Tighten up remote ssh access===&lt;br /&gt;
Been having some issues with port scanning and automated log in attempts from all over the world.  You can initially lock things down by disabling the default account from ssh login (after creating your first other user in the previous step).  First up, edit the ssh server configuration.  The file is found in ''/etc/ssh/sshd_config'':&lt;br /&gt;
&amp;lt;pre&amp;gt; editor /etc/ssh/sshd_config&amp;lt;/pre&amp;gt;&lt;br /&gt;
Add these lines to that file (or verify that they are there / double check that you aren't duplicating and creating confusion for the daemon):&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
## Disable root login:&lt;br /&gt;
PermitRootLogin no&lt;br /&gt;
##specify which users can log in over ssh:&lt;br /&gt;
AllowUsers scientist&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
With that out of the way, restart the ssh server and you have taken a step towards better securing the system:&lt;br /&gt;
&amp;lt;pre&amp;gt;service ssh restart&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Update Firewall:===&lt;br /&gt;
Firewall is complicated.  I'm not 100% I have this correct but it's quite a bit more secure than the defaults and such.  It's worth its own entry though:&lt;br /&gt;
* [[IP Tables Firewall Example]]&lt;br /&gt;
&lt;br /&gt;
===update apt &amp;amp; all packages===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt-get update&lt;br /&gt;
apt-get upgrade&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Raspberry Pi specific: Resize Partition===&lt;br /&gt;
Run this utility as root:&lt;br /&gt;
&amp;lt;pre&amp;gt;raspi-config&amp;lt;/pre&amp;gt;&lt;br /&gt;
One of the options (the first one) is:&lt;br /&gt;
&amp;lt;pre&amp;gt;1 Expand Filesystem            Ensures that all of the SD card storage is available to the OS  &amp;lt;/pre&amp;gt;&lt;br /&gt;
Select that and the file system will go from the default, like 1.3 GB and expand to consume the whole card.  See here for a bit more discussion:&amp;lt;br&amp;gt;&lt;br /&gt;
http://raspberrypi.stackexchange.com/questions/499/how-can-i-resize-my-root-partition&lt;br /&gt;
&lt;br /&gt;
===Install additional packages===&lt;br /&gt;
Great, if you've made it this far then you should have a decently secure system, nearly ready for deployment.  There are a few more pacakges it is smart to install...  kind of depends on what you are doing whether you add all of them or not but there first are a good move.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; apt-get install nmap ntp less imagemagick python mailutils fail2ban ser2net git telnet screen wget curl&amp;lt;/pre&amp;gt;&lt;br /&gt;
* '''nmap''' is useful for checking out the internet presence of your device.  Kind of optional but nice to have installed if you need it at a later date.&lt;br /&gt;
** https://packages.debian.org/stable/nmap&lt;br /&gt;
* '''ntp''' is the time server, used to get internet time.  It should be installed by default but I have found it isn't alway.  So, best to be explicit and install it here.&lt;br /&gt;
** https://packages.debian.org/jessie/ntp&lt;br /&gt;
* '''less'''  is a simple command line utility for reading text files. A gain, it should be installed by default but I have run into it not being installed.&lt;br /&gt;
** https://packages.debian.org/jessie/less&lt;br /&gt;
* '''imagemagick''' is a great command line based image manipulation library.  Used by a few different utilities. I think we use it to resize / slice automatically generated plots, and to do some other stuff in Barrow.&lt;br /&gt;
** https://packages.debian.org/jessie/imagemagick&lt;br /&gt;
* '''python''' common programming language we use extensively and should be added to the system.&lt;br /&gt;
* '''mailutils''' is a simple email package.  Used by crontab &amp;amp; the security updates system (as well as others I'm forgetting) to give you status information.&lt;br /&gt;
* '''fail2ban''' is used to lockdown ssh a bit further than the default ip tables rules.  It blocks IP addresses that try to log in too often with a bad user/password.  Intended to reduce workload of these simple computers handling garbage so they can focus on serving as a serial base station etc.&lt;br /&gt;
* '''ser2net''' pretty solid utility for getting serial port access (or usb to serial access) via sockets. This is the primary thing we use to handle getting data logger information available over the internet.  For multipoint radios, there is also a '''ser2nets''' which can allow more than one LoggerNet instance to access the radio network simultaneously.  I haven't used ser2nets but have thought about experimenting with it.&lt;br /&gt;
* '''git'''  we use this for distributing datapro and other utilities&lt;br /&gt;
* ''telnet'' useful for testing ser2net's operation.&lt;br /&gt;
* ''screen'' useful for testing the usb to serial device&lt;br /&gt;
* ''curl'' utility for grabbing web pages / data from servers&lt;br /&gt;
* ''wget'' utility for grabbing web pages / data from servers&lt;br /&gt;
&lt;br /&gt;
====Automatically install security updates:====&lt;br /&gt;
The last generally mandatory package to add is the Unattended security updates.  There are couple packages to install but there are also some configs to modify It's best to just read this page. &amp;lt;br&amp;gt;&lt;br /&gt;
https://wiki.debian.org/UnattendedUpgrades&amp;lt;br&amp;gt;&lt;br /&gt;
But, I can also give you a hint that you'll need to do at least these three things from the command line:&lt;br /&gt;
&amp;lt;pre&amp;gt;apt-get install unattended-upgrades apt-listchanges&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;editor /etc/apt/apt.conf.d/50unattended-upgrades&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;editor /etc/apt/apt.conf.d/20auto-upgrades&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Other packages===&lt;br /&gt;
So, those are typically the base to get you up and running.  Then, this next set are slightly more specialized.  If you are going to do any data processing or use the WERC data retrieval tools these are good to install:&lt;br /&gt;
 apt-get install build-essential libdbi-perl libconfig-yaml-perl python-numpy python-tz python-pandas liblockfile-simple-perl libdbi-perl bc&lt;br /&gt;
 apt-get install python-gdal python-xlrd python-scipy autossh&lt;br /&gt;
&lt;br /&gt;
===check timezone===&lt;br /&gt;
Important to confirm we are using UTC:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dpkg-reconfigure tzdata &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Next steps===&lt;br /&gt;
So, at this point you have a system that has now been tailored to generic deployment.  With that out of the way there are some specific things and tools / scripts that are nice to give you a bit more feedback. For example. it needs to tell you its IP address routinely so there are some things to set up in order to make that happen like:&lt;br /&gt;
* set up a private key in the ''scientist'' user account so you can automate the transfer&lt;br /&gt;
** follow this: http://troy.jdmz.net/rsync/index.html&lt;br /&gt;
**  '''ssh-keygen -t rsa -b 2048 '''&lt;br /&gt;
** then, add the key to the server you want to push too:&lt;br /&gt;
*** '''ssh-copy-id scientist@ngeedata.iarc.uaf.edu'''&lt;br /&gt;
* set up the crontab so that the automated stuff is configured to happen... do all of this from your user account rather than your root account.&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
mkdir ~/bin&lt;br /&gt;
nano ~/bin/main_cron&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* add something like this to the file main_cron to transmit the IP address every 10 minutes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
*/10 * * * * /sbin/ifconfig &amp;gt; /home/scientist/grayling_ip.txt&lt;br /&gt;
*/10 * * * * scp -oport=2222 /home/scientist/grayling_ip.txt user@ngeedata.iarc.uaf.edu:/home/user/remote_ips/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* add this to the crontab:&lt;br /&gt;
&amp;lt;pre&amp;gt; crontab ~/bin/main_cron&amp;lt;/pre&amp;gt;&lt;br /&gt;
* confirm that it is in the crontab:&lt;br /&gt;
&amp;lt;pre&amp;gt; crontab -l&amp;lt;/pre&amp;gt;&lt;br /&gt;
Great, &lt;br /&gt;
* set up a few more bash scripts... running out of steam here I'm just going to list commands for a bit and then annotate later.&lt;br /&gt;
* this gets Ross' csv utilities with datapro plus a number of other things installed&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~/bin/&lt;br /&gt;
git clone https://github.com/rwspicer/csv_utilities.git&lt;br /&gt;
python ~/bin/csv_utilities/get_ip.py --infile=/home/scientist/extra/grayling_ip.txt --outfile=/home/scientist/grayling_ip&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* also need to configure ser2net:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo nano /etc/ser2net.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
* remove the existing lines at the bottom of the configuration and add this:&lt;br /&gt;
** specifying the port as ''7808''&lt;br /&gt;
** data type is '''''raw''''' ''(default is telnet)''&lt;br /&gt;
** serial to usb device is ''/dev/ttyUSB0''&lt;br /&gt;
** speed and data information (this is standard of most of our serial things though the baud rate may change depending on application): ''115200 8DATABITS NONE 1STOPBIT''&lt;br /&gt;
** a few additional parameters to close the connection and reset the radio after each use: '' HANGUP_WHEN_DONE RTSCTS LOCAL''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# IARC radio&lt;br /&gt;
7808:raw:25:/dev/ttyUSB0:115200 8DATABITS NONE 1STOPBIT HANGUP_WHEN_DONE RTSCTS LOCAL&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* now, reload ser2net daemon with new configuration:&lt;br /&gt;
&amp;lt;pre&amp;gt;service ser2net restart&amp;lt;/pre&amp;gt;&lt;br /&gt;
* next, test your setup:&lt;br /&gt;
&amp;lt;pre&amp;gt; telnet localhost 7808&amp;lt;/pre&amp;gt;&lt;br /&gt;
** then hit enter a bunch and watch for a reply from the data logger.  If you see it, awesome. to close the program, hold down the control key and press the close bracket key.  This will bring up a new prompt:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;CONTROL&amp;gt;&amp;lt;]&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
** then:&lt;br /&gt;
&amp;lt;pre&amp;gt;close&amp;lt;/pre&amp;gt;&lt;br /&gt;
* if that works, fantastic.  If that doesn't, try connecting directly to the serial port using ''screen'':&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo screen /dev/ttyUSB0 9600&amp;lt;/pre&amp;gt;&lt;br /&gt;
** If that works, awesome!  To quit screen then enter:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;CONTROL&amp;gt; - &amp;lt;A&amp;gt;  (press and hold control, then press A)&lt;br /&gt;
&amp;lt;COLON&amp;gt;&lt;br /&gt;
&amp;lt;TYPE&amp;gt; quit &amp;lt;/TYPE&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* if that works, then you have a good serial connection and may just need to tweak the ser2net configuration.&lt;br /&gt;
** I just noticed here that &amp;lt;pre&amp;gt;service ser2net restart&amp;lt;/pre&amp;gt; didn't properly reload the configuration file.  However this did:&lt;br /&gt;
&amp;lt;pre&amp;gt;service ser2net stop&lt;br /&gt;
service ser2net start&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Yet to come===&lt;br /&gt;
So, at this point you have a solid serial server.  There is often more functionality you can add though depending on how things go.  For instance, the speed test bash script may need to be installed, there might be webcam&lt;br /&gt;
===Intel Nucs===&lt;br /&gt;
====BIOS Fixes====&lt;br /&gt;
* Power screen&lt;br /&gt;
** Secondary Power Settings:&lt;br /&gt;
*** After Power failure Power On&lt;br /&gt;
*** Wake System from S5&lt;br /&gt;
*****Wake daily &lt;br /&gt;
* Boot&lt;br /&gt;
** Boot Configureation&lt;br /&gt;
*** UEFI Boot OS Selection Linux&lt;br /&gt;
** Secure Boot&lt;br /&gt;
*** Secure Boot Disabled&lt;br /&gt;
* Devices and Peripherals&lt;br /&gt;
** Onboard Devices&lt;br /&gt;
*** Audio Disabled&lt;br /&gt;
*** HD-Audio Disabled&lt;br /&gt;
*** Microphone Disabled&lt;br /&gt;
*** WLAN Disabled&lt;br /&gt;
*** Bluetooth Disabled&lt;br /&gt;
** Legacy Device Configuration&lt;br /&gt;
*** Enhanced Consumer IR Disabled&lt;br /&gt;
*** HDMI CEC Control Disabled&lt;br /&gt;
===After Debian Install Fixes===&lt;br /&gt;
* Enable non-free in /etc/apt/sources.list&lt;br /&gt;
* install closed source firmware:&lt;br /&gt;
 apt-get install firmware-realtek&lt;/div&gt;</summary>
		<author><name>172.20.235.108</name></author>
		
	</entry>
	<entry>
		<id>http://ocotal.iarc.uaf.edu/index.php?title=Initial_Debian_Server_Setup&amp;diff=2463</id>
		<title>Initial Debian Server Setup</title>
		<link rel="alternate" type="text/html" href="http://ocotal.iarc.uaf.edu/index.php?title=Initial_Debian_Server_Setup&amp;diff=2463"/>
		<updated>2018-07-19T22:06:53Z</updated>

		<summary type="html">&lt;p&gt;172.20.235.108: /* Intel Nucs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[IARC Server List]]&lt;br /&gt;
==Step by step (roughly) procedure for getting a Debian-ARM server up and running for remote deployment as a serial radio base or a number of other things==&lt;br /&gt;
Been meaning to put this together for a while.&lt;br /&gt;
===Download media===&lt;br /&gt;
A lot of these ARM based systems have a microSD or SD card image that can be flashed from an online source.  I like to use the most recent stable version of Debian if it's available and also the minimum size image so that less extra cruft is installed (don't need a window manager etc)&amp;lt;br&amp;gt;&lt;br /&gt;
The RaspberryPis work well, too but have less horsepower under the hood:&amp;lt;br&amp;gt;&lt;br /&gt;
https://www.raspberrypi.org/downloads/raspbian/&amp;lt;br&amp;gt;&lt;br /&gt;
This is more powerful but doesn't come with a vanilla kernel (this means long term updating is harder):&amp;lt;br&amp;gt;&lt;br /&gt;
http://wiki.solid-run.com/doku.php?id=products:imx6:overview:flashsdcard&lt;br /&gt;
&lt;br /&gt;
We also have a few units (the DreamPlug and the GuruPlug) from GlobalScale but the power supplies have become flaky over time and I think the cubox-i is current favorite.&amp;lt;br&amp;gt;&lt;br /&gt;
https://www.globalscaletechnologies.com/&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I guess in addition, also using intel based NUC which is slightly larger, maybe more powerful but the cpu instruction set is x86 rather than ARM.   For Debian, that means nothing but it should also mean we can run loggernet for linux further afield.  (this is on my later in the winter list).&lt;br /&gt;
&lt;br /&gt;
===First step===&lt;br /&gt;
#Download the current image of the OS available online to your computer&lt;br /&gt;
## http://wiki.solid-run.com/doku.php?id=products:imx6:software:os:debian&amp;lt;br&amp;gt;&lt;br /&gt;
## https://www.raspberrypi.org/downloads/raspbian/&amp;lt;br&amp;gt;&lt;br /&gt;
# Flash it to the appropriate media (microSD or SD card typically).  Something like this:&lt;br /&gt;
## sudo dd if=~/Downloads/ignition.img of=/dev/rdisk2 bs=4096 ''' (cubox-i example)'''&lt;br /&gt;
## sudo dd if=2015-11-21-raspbian-jessie-lite.img of=/dev/rdisk2 bs=4096 '''(Raspberry Pi example)'''&lt;br /&gt;
# Look up online the default user / password to get into the system once it is up and running, too.  &lt;br /&gt;
## A simple search for something like &amp;quot;''Raspberry pi default user name and password''&amp;quot; should get you close.&lt;br /&gt;
# Once you're up and running, log in as the default user and then let's do some set up in an interactive sudo session:&lt;br /&gt;
&amp;lt;pre&amp;gt; sudo -i&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===For raspberry pi, change keyboard layout to US===&lt;br /&gt;
Default is UK English layout... before you change the passwords you should get a US layout keyboard. Here is a good resource&amp;lt;br&amp;gt;&lt;br /&gt;
https://wiki.debian.org/Keyboard&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;dpkg-reconfigure keyboard-configuration&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt; service keyboard-setup restart&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Create user accounts===&lt;br /&gt;
(junk name here not what you might see on our systems)&lt;br /&gt;
&amp;lt;pre&amp;gt; adduser scientist&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== give the user extended permissions===&lt;br /&gt;
https://wiki.debian.org/sudo&lt;br /&gt;
&amp;lt;pre&amp;gt;adduser scientist sudo&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Tighten up remote ssh access===&lt;br /&gt;
Been having some issues with port scanning and automated log in attempts from all over the world.  You can initially lock things down by disabling the default account from ssh login (after creating your first other user in the previous step).  First up, edit the ssh server configuration.  The file is found in ''/etc/ssh/sshd_config'':&lt;br /&gt;
&amp;lt;pre&amp;gt; editor /etc/ssh/sshd_config&amp;lt;/pre&amp;gt;&lt;br /&gt;
Add these lines to that file (or verify that they are there / double check that you aren't duplicating and creating confusion for the daemon):&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
## Disable root login:&lt;br /&gt;
PermitRootLogin no&lt;br /&gt;
##specify which users can log in over ssh:&lt;br /&gt;
AllowUsers scientist&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
With that out of the way, restart the ssh server and you have taken a step towards better securing the system:&lt;br /&gt;
&amp;lt;pre&amp;gt;service ssh restart&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Update Firewall:===&lt;br /&gt;
Firewall is complicated.  I'm not 100% I have this correct but it's quite a bit more secure than the defaults and such.  It's worth its own entry though:&lt;br /&gt;
* [[IP Tables Firewall Example]]&lt;br /&gt;
&lt;br /&gt;
===update apt &amp;amp; all packages===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt-get update&lt;br /&gt;
apt-get upgrade&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Raspberry Pi specific: Resize Partition===&lt;br /&gt;
Run this utility as root:&lt;br /&gt;
&amp;lt;pre&amp;gt;raspi-config&amp;lt;/pre&amp;gt;&lt;br /&gt;
One of the options (the first one) is:&lt;br /&gt;
&amp;lt;pre&amp;gt;1 Expand Filesystem            Ensures that all of the SD card storage is available to the OS  &amp;lt;/pre&amp;gt;&lt;br /&gt;
Select that and the file system will go from the default, like 1.3 GB and expand to consume the whole card.  See here for a bit more discussion:&amp;lt;br&amp;gt;&lt;br /&gt;
http://raspberrypi.stackexchange.com/questions/499/how-can-i-resize-my-root-partition&lt;br /&gt;
&lt;br /&gt;
===Install additional packages===&lt;br /&gt;
Great, if you've made it this far then you should have a decently secure system, nearly ready for deployment.  There are a few more pacakges it is smart to install...  kind of depends on what you are doing whether you add all of them or not but there first are a good move.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; apt-get install nmap ntp less imagemagick python mailutils fail2ban ser2net git telnet screen wget curl&amp;lt;/pre&amp;gt;&lt;br /&gt;
* '''nmap''' is useful for checking out the internet presence of your device.  Kind of optional but nice to have installed if you need it at a later date.&lt;br /&gt;
** https://packages.debian.org/stable/nmap&lt;br /&gt;
* '''ntp''' is the time server, used to get internet time.  It should be installed by default but I have found it isn't alway.  So, best to be explicit and install it here.&lt;br /&gt;
** https://packages.debian.org/jessie/ntp&lt;br /&gt;
* '''less'''  is a simple command line utility for reading text files. A gain, it should be installed by default but I have run into it not being installed.&lt;br /&gt;
** https://packages.debian.org/jessie/less&lt;br /&gt;
* '''imagemagick''' is a great command line based image manipulation library.  Used by a few different utilities. I think we use it to resize / slice automatically generated plots, and to do some other stuff in Barrow.&lt;br /&gt;
** https://packages.debian.org/jessie/imagemagick&lt;br /&gt;
* '''python''' common programming language we use extensively and should be added to the system.&lt;br /&gt;
* '''mailutils''' is a simple email package.  Used by crontab &amp;amp; the security updates system (as well as others I'm forgetting) to give you status information.&lt;br /&gt;
* '''fail2ban''' is used to lockdown ssh a bit further than the default ip tables rules.  It blocks IP addresses that try to log in too often with a bad user/password.  Intended to reduce workload of these simple computers handling garbage so they can focus on serving as a serial base station etc.&lt;br /&gt;
* '''ser2net''' pretty solid utility for getting serial port access (or usb to serial access) via sockets. This is the primary thing we use to handle getting data logger information available over the internet.  For multipoint radios, there is also a '''ser2nets''' which can allow more than one LoggerNet instance to access the radio network simultaneously.  I haven't used ser2nets but have thought about experimenting with it.&lt;br /&gt;
* '''git'''  we use this for distributing datapro and other utilities&lt;br /&gt;
* ''telnet'' useful for testing ser2net's operation.&lt;br /&gt;
* ''screen'' useful for testing the usb to serial device&lt;br /&gt;
* ''curl'' utility for grabbing web pages / data from servers&lt;br /&gt;
* ''wget'' utility for grabbing web pages / data from servers&lt;br /&gt;
&lt;br /&gt;
====Automatically install security updates:====&lt;br /&gt;
The last generally mandatory package to add is the Unattended security updates.  There are couple packages to install but there are also some configs to modify It's best to just read this page. &amp;lt;br&amp;gt;&lt;br /&gt;
https://wiki.debian.org/UnattendedUpgrades&amp;lt;br&amp;gt;&lt;br /&gt;
But, I can also give you a hint that you'll need to do at least these three things from the command line:&lt;br /&gt;
&amp;lt;pre&amp;gt;apt-get install unattended-upgrades apt-listchanges&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;editor /etc/apt/apt.conf.d/50unattended-upgrades&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;editor /etc/apt/apt.conf.d/20auto-upgrades&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Other packages===&lt;br /&gt;
So, those are typically the base to get you up and running.  Then, this next set are slightly more specialized.  If you are going to do any data processing or use the WERC data retrieval tools these are good to install:&lt;br /&gt;
 apt-get install build-essential libdbi-perl libconfig-yaml-perl python-numpy python-tz python-pandas liblockfile-simple-perl libdbi-perl bc&lt;br /&gt;
 apt-get install python-gdal python-xlrd python-scipy&lt;br /&gt;
&lt;br /&gt;
===check timezone===&lt;br /&gt;
Important to confirm we are using UTC:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dpkg-reconfigure tzdata &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Next steps===&lt;br /&gt;
So, at this point you have a system that has now been tailored to generic deployment.  With that out of the way there are some specific things and tools / scripts that are nice to give you a bit more feedback. For example. it needs to tell you its IP address routinely so there are some things to set up in order to make that happen like:&lt;br /&gt;
* set up a private key in the ''scientist'' user account so you can automate the transfer&lt;br /&gt;
** follow this: http://troy.jdmz.net/rsync/index.html&lt;br /&gt;
**  '''ssh-keygen -t rsa -b 2048 '''&lt;br /&gt;
** then, add the key to the server you want to push too:&lt;br /&gt;
*** '''ssh-copy-id scientist@ngeedata.iarc.uaf.edu'''&lt;br /&gt;
* set up the crontab so that the automated stuff is configured to happen... do all of this from your user account rather than your root account.&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
mkdir ~/bin&lt;br /&gt;
nano ~/bin/main_cron&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* add something like this to the file main_cron to transmit the IP address every 10 minutes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
*/10 * * * * /sbin/ifconfig &amp;gt; /home/scientist/grayling_ip.txt&lt;br /&gt;
*/10 * * * * scp -oport=2222 /home/scientist/grayling_ip.txt user@ngeedata.iarc.uaf.edu:/home/user/remote_ips/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* add this to the crontab:&lt;br /&gt;
&amp;lt;pre&amp;gt; crontab ~/bin/main_cron&amp;lt;/pre&amp;gt;&lt;br /&gt;
* confirm that it is in the crontab:&lt;br /&gt;
&amp;lt;pre&amp;gt; crontab -l&amp;lt;/pre&amp;gt;&lt;br /&gt;
Great, &lt;br /&gt;
* set up a few more bash scripts... running out of steam here I'm just going to list commands for a bit and then annotate later.&lt;br /&gt;
* this gets Ross' csv utilities with datapro plus a number of other things installed&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~/bin/&lt;br /&gt;
git clone https://github.com/rwspicer/csv_utilities.git&lt;br /&gt;
python ~/bin/csv_utilities/get_ip.py --infile=/home/scientist/extra/grayling_ip.txt --outfile=/home/scientist/grayling_ip&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* also need to configure ser2net:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo nano /etc/ser2net.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
* remove the existing lines at the bottom of the configuration and add this:&lt;br /&gt;
** specifying the port as ''7808''&lt;br /&gt;
** data type is '''''raw''''' ''(default is telnet)''&lt;br /&gt;
** serial to usb device is ''/dev/ttyUSB0''&lt;br /&gt;
** speed and data information (this is standard of most of our serial things though the baud rate may change depending on application): ''115200 8DATABITS NONE 1STOPBIT''&lt;br /&gt;
** a few additional parameters to close the connection and reset the radio after each use: '' HANGUP_WHEN_DONE RTSCTS LOCAL''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# IARC radio&lt;br /&gt;
7808:raw:25:/dev/ttyUSB0:115200 8DATABITS NONE 1STOPBIT HANGUP_WHEN_DONE RTSCTS LOCAL&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* now, reload ser2net daemon with new configuration:&lt;br /&gt;
&amp;lt;pre&amp;gt;service ser2net restart&amp;lt;/pre&amp;gt;&lt;br /&gt;
* next, test your setup:&lt;br /&gt;
&amp;lt;pre&amp;gt; telnet localhost 7808&amp;lt;/pre&amp;gt;&lt;br /&gt;
** then hit enter a bunch and watch for a reply from the data logger.  If you see it, awesome. to close the program, hold down the control key and press the close bracket key.  This will bring up a new prompt:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;CONTROL&amp;gt;&amp;lt;]&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
** then:&lt;br /&gt;
&amp;lt;pre&amp;gt;close&amp;lt;/pre&amp;gt;&lt;br /&gt;
* if that works, fantastic.  If that doesn't, try connecting directly to the serial port using ''screen'':&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo screen /dev/ttyUSB0 9600&amp;lt;/pre&amp;gt;&lt;br /&gt;
** If that works, awesome!  To quit screen then enter:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;CONTROL&amp;gt; - &amp;lt;A&amp;gt;  (press and hold control, then press A)&lt;br /&gt;
&amp;lt;COLON&amp;gt;&lt;br /&gt;
&amp;lt;TYPE&amp;gt; quit &amp;lt;/TYPE&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* if that works, then you have a good serial connection and may just need to tweak the ser2net configuration.&lt;br /&gt;
** I just noticed here that &amp;lt;pre&amp;gt;service ser2net restart&amp;lt;/pre&amp;gt; didn't properly reload the configuration file.  However this did:&lt;br /&gt;
&amp;lt;pre&amp;gt;service ser2net stop&lt;br /&gt;
service ser2net start&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Yet to come===&lt;br /&gt;
So, at this point you have a solid serial server.  There is often more functionality you can add though depending on how things go.  For instance, the speed test bash script may need to be installed, there might be webcam&lt;br /&gt;
===Intel Nucs===&lt;br /&gt;
====BIOS Fixes====&lt;br /&gt;
* Power screen&lt;br /&gt;
** Secondary Power Settings:&lt;br /&gt;
*** After Power failure Power On&lt;br /&gt;
*** Wake System from S5&lt;br /&gt;
*****Wake daily &lt;br /&gt;
* Boot&lt;br /&gt;
** Boot Configureation&lt;br /&gt;
*** UEFI Boot OS Selection Linux&lt;br /&gt;
** Secure Boot&lt;br /&gt;
*** Secure Boot Disabled&lt;br /&gt;
* Devices and Peripherals&lt;br /&gt;
** Onboard Devices&lt;br /&gt;
*** Audio Disabled&lt;br /&gt;
*** HD-Audio Disabled&lt;br /&gt;
*** Microphone Disabled&lt;br /&gt;
*** WLAN Disabled&lt;br /&gt;
*** Bluetooth Disabled&lt;br /&gt;
** Legacy Device Configuration&lt;br /&gt;
*** Enhanced Consumer IR Disabled&lt;br /&gt;
*** HDMI CEC Control Disabled&lt;br /&gt;
===After Debian Install Fixes===&lt;br /&gt;
* Enable non-free in /etc/apt/sources.list&lt;br /&gt;
* install closed source firmware:&lt;br /&gt;
 apt-get install firmware-realtek&lt;/div&gt;</summary>
		<author><name>172.20.235.108</name></author>
		
	</entry>
	<entry>
		<id>http://ocotal.iarc.uaf.edu/index.php?title=Initial_Debian_Server_Setup&amp;diff=2462</id>
		<title>Initial Debian Server Setup</title>
		<link rel="alternate" type="text/html" href="http://ocotal.iarc.uaf.edu/index.php?title=Initial_Debian_Server_Setup&amp;diff=2462"/>
		<updated>2018-07-19T21:32:46Z</updated>

		<summary type="html">&lt;p&gt;172.20.235.108: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[IARC Server List]]&lt;br /&gt;
==Step by step (roughly) procedure for getting a Debian-ARM server up and running for remote deployment as a serial radio base or a number of other things==&lt;br /&gt;
Been meaning to put this together for a while.&lt;br /&gt;
===Download media===&lt;br /&gt;
A lot of these ARM based systems have a microSD or SD card image that can be flashed from an online source.  I like to use the most recent stable version of Debian if it's available and also the minimum size image so that less extra cruft is installed (don't need a window manager etc)&amp;lt;br&amp;gt;&lt;br /&gt;
The RaspberryPis work well, too but have less horsepower under the hood:&amp;lt;br&amp;gt;&lt;br /&gt;
https://www.raspberrypi.org/downloads/raspbian/&amp;lt;br&amp;gt;&lt;br /&gt;
This is more powerful but doesn't come with a vanilla kernel (this means long term updating is harder):&amp;lt;br&amp;gt;&lt;br /&gt;
http://wiki.solid-run.com/doku.php?id=products:imx6:overview:flashsdcard&lt;br /&gt;
&lt;br /&gt;
We also have a few units (the DreamPlug and the GuruPlug) from GlobalScale but the power supplies have become flaky over time and I think the cubox-i is current favorite.&amp;lt;br&amp;gt;&lt;br /&gt;
https://www.globalscaletechnologies.com/&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I guess in addition, also using intel based NUC which is slightly larger, maybe more powerful but the cpu instruction set is x86 rather than ARM.   For Debian, that means nothing but it should also mean we can run loggernet for linux further afield.  (this is on my later in the winter list).&lt;br /&gt;
&lt;br /&gt;
===First step===&lt;br /&gt;
#Download the current image of the OS available online to your computer&lt;br /&gt;
## http://wiki.solid-run.com/doku.php?id=products:imx6:software:os:debian&amp;lt;br&amp;gt;&lt;br /&gt;
## https://www.raspberrypi.org/downloads/raspbian/&amp;lt;br&amp;gt;&lt;br /&gt;
# Flash it to the appropriate media (microSD or SD card typically).  Something like this:&lt;br /&gt;
## sudo dd if=~/Downloads/ignition.img of=/dev/rdisk2 bs=4096 ''' (cubox-i example)'''&lt;br /&gt;
## sudo dd if=2015-11-21-raspbian-jessie-lite.img of=/dev/rdisk2 bs=4096 '''(Raspberry Pi example)'''&lt;br /&gt;
# Look up online the default user / password to get into the system once it is up and running, too.  &lt;br /&gt;
## A simple search for something like &amp;quot;''Raspberry pi default user name and password''&amp;quot; should get you close.&lt;br /&gt;
# Once you're up and running, log in as the default user and then let's do some set up in an interactive sudo session:&lt;br /&gt;
&amp;lt;pre&amp;gt; sudo -i&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===For raspberry pi, change keyboard layout to US===&lt;br /&gt;
Default is UK English layout... before you change the passwords you should get a US layout keyboard. Here is a good resource&amp;lt;br&amp;gt;&lt;br /&gt;
https://wiki.debian.org/Keyboard&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;dpkg-reconfigure keyboard-configuration&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt; service keyboard-setup restart&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Create user accounts===&lt;br /&gt;
(junk name here not what you might see on our systems)&lt;br /&gt;
&amp;lt;pre&amp;gt; adduser scientist&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== give the user extended permissions===&lt;br /&gt;
https://wiki.debian.org/sudo&lt;br /&gt;
&amp;lt;pre&amp;gt;adduser scientist sudo&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Tighten up remote ssh access===&lt;br /&gt;
Been having some issues with port scanning and automated log in attempts from all over the world.  You can initially lock things down by disabling the default account from ssh login (after creating your first other user in the previous step).  First up, edit the ssh server configuration.  The file is found in ''/etc/ssh/sshd_config'':&lt;br /&gt;
&amp;lt;pre&amp;gt; editor /etc/ssh/sshd_config&amp;lt;/pre&amp;gt;&lt;br /&gt;
Add these lines to that file (or verify that they are there / double check that you aren't duplicating and creating confusion for the daemon):&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
## Disable root login:&lt;br /&gt;
PermitRootLogin no&lt;br /&gt;
##specify which users can log in over ssh:&lt;br /&gt;
AllowUsers scientist&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
With that out of the way, restart the ssh server and you have taken a step towards better securing the system:&lt;br /&gt;
&amp;lt;pre&amp;gt;service ssh restart&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Update Firewall:===&lt;br /&gt;
Firewall is complicated.  I'm not 100% I have this correct but it's quite a bit more secure than the defaults and such.  It's worth its own entry though:&lt;br /&gt;
* [[IP Tables Firewall Example]]&lt;br /&gt;
&lt;br /&gt;
===update apt &amp;amp; all packages===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt-get update&lt;br /&gt;
apt-get upgrade&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Raspberry Pi specific: Resize Partition===&lt;br /&gt;
Run this utility as root:&lt;br /&gt;
&amp;lt;pre&amp;gt;raspi-config&amp;lt;/pre&amp;gt;&lt;br /&gt;
One of the options (the first one) is:&lt;br /&gt;
&amp;lt;pre&amp;gt;1 Expand Filesystem            Ensures that all of the SD card storage is available to the OS  &amp;lt;/pre&amp;gt;&lt;br /&gt;
Select that and the file system will go from the default, like 1.3 GB and expand to consume the whole card.  See here for a bit more discussion:&amp;lt;br&amp;gt;&lt;br /&gt;
http://raspberrypi.stackexchange.com/questions/499/how-can-i-resize-my-root-partition&lt;br /&gt;
&lt;br /&gt;
===Install additional packages===&lt;br /&gt;
Great, if you've made it this far then you should have a decently secure system, nearly ready for deployment.  There are a few more pacakges it is smart to install...  kind of depends on what you are doing whether you add all of them or not but there first are a good move.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; apt-get install nmap ntp less imagemagick python mailutils fail2ban ser2net git telnet screen wget curl&amp;lt;/pre&amp;gt;&lt;br /&gt;
* '''nmap''' is useful for checking out the internet presence of your device.  Kind of optional but nice to have installed if you need it at a later date.&lt;br /&gt;
** https://packages.debian.org/stable/nmap&lt;br /&gt;
* '''ntp''' is the time server, used to get internet time.  It should be installed by default but I have found it isn't alway.  So, best to be explicit and install it here.&lt;br /&gt;
** https://packages.debian.org/jessie/ntp&lt;br /&gt;
* '''less'''  is a simple command line utility for reading text files. A gain, it should be installed by default but I have run into it not being installed.&lt;br /&gt;
** https://packages.debian.org/jessie/less&lt;br /&gt;
* '''imagemagick''' is a great command line based image manipulation library.  Used by a few different utilities. I think we use it to resize / slice automatically generated plots, and to do some other stuff in Barrow.&lt;br /&gt;
** https://packages.debian.org/jessie/imagemagick&lt;br /&gt;
* '''python''' common programming language we use extensively and should be added to the system.&lt;br /&gt;
* '''mailutils''' is a simple email package.  Used by crontab &amp;amp; the security updates system (as well as others I'm forgetting) to give you status information.&lt;br /&gt;
* '''fail2ban''' is used to lockdown ssh a bit further than the default ip tables rules.  It blocks IP addresses that try to log in too often with a bad user/password.  Intended to reduce workload of these simple computers handling garbage so they can focus on serving as a serial base station etc.&lt;br /&gt;
* '''ser2net''' pretty solid utility for getting serial port access (or usb to serial access) via sockets. This is the primary thing we use to handle getting data logger information available over the internet.  For multipoint radios, there is also a '''ser2nets''' which can allow more than one LoggerNet instance to access the radio network simultaneously.  I haven't used ser2nets but have thought about experimenting with it.&lt;br /&gt;
* '''git'''  we use this for distributing datapro and other utilities&lt;br /&gt;
* ''telnet'' useful for testing ser2net's operation.&lt;br /&gt;
* ''screen'' useful for testing the usb to serial device&lt;br /&gt;
* ''curl'' utility for grabbing web pages / data from servers&lt;br /&gt;
* ''wget'' utility for grabbing web pages / data from servers&lt;br /&gt;
&lt;br /&gt;
====Automatically install security updates:====&lt;br /&gt;
The last generally mandatory package to add is the Unattended security updates.  There are couple packages to install but there are also some configs to modify It's best to just read this page. &amp;lt;br&amp;gt;&lt;br /&gt;
https://wiki.debian.org/UnattendedUpgrades&amp;lt;br&amp;gt;&lt;br /&gt;
But, I can also give you a hint that you'll need to do at least these three things from the command line:&lt;br /&gt;
&amp;lt;pre&amp;gt;apt-get install unattended-upgrades apt-listchanges&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;editor /etc/apt/apt.conf.d/50unattended-upgrades&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;editor /etc/apt/apt.conf.d/20auto-upgrades&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Other packages===&lt;br /&gt;
So, those are typically the base to get you up and running.  Then, this next set are slightly more specialized.  If you are going to do any data processing or use the WERC data retrieval tools these are good to install:&lt;br /&gt;
 apt-get install build-essential libdbi-perl libconfig-yaml-perl python-numpy python-tz python-pandas liblockfile-simple-perl libdbi-perl bc&lt;br /&gt;
 apt-get install python-gdal python-xlrd python-scipy&lt;br /&gt;
&lt;br /&gt;
===check timezone===&lt;br /&gt;
Important to confirm we are using UTC:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dpkg-reconfigure tzdata &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Next steps===&lt;br /&gt;
So, at this point you have a system that has now been tailored to generic deployment.  With that out of the way there are some specific things and tools / scripts that are nice to give you a bit more feedback. For example. it needs to tell you its IP address routinely so there are some things to set up in order to make that happen like:&lt;br /&gt;
* set up a private key in the ''scientist'' user account so you can automate the transfer&lt;br /&gt;
** follow this: http://troy.jdmz.net/rsync/index.html&lt;br /&gt;
**  '''ssh-keygen -t rsa -b 2048 '''&lt;br /&gt;
** then, add the key to the server you want to push too:&lt;br /&gt;
*** '''ssh-copy-id scientist@ngeedata.iarc.uaf.edu'''&lt;br /&gt;
* set up the crontab so that the automated stuff is configured to happen... do all of this from your user account rather than your root account.&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
mkdir ~/bin&lt;br /&gt;
nano ~/bin/main_cron&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* add something like this to the file main_cron to transmit the IP address every 10 minutes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
*/10 * * * * /sbin/ifconfig &amp;gt; /home/scientist/grayling_ip.txt&lt;br /&gt;
*/10 * * * * scp -oport=2222 /home/scientist/grayling_ip.txt user@ngeedata.iarc.uaf.edu:/home/user/remote_ips/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* add this to the crontab:&lt;br /&gt;
&amp;lt;pre&amp;gt; crontab ~/bin/main_cron&amp;lt;/pre&amp;gt;&lt;br /&gt;
* confirm that it is in the crontab:&lt;br /&gt;
&amp;lt;pre&amp;gt; crontab -l&amp;lt;/pre&amp;gt;&lt;br /&gt;
Great, &lt;br /&gt;
* set up a few more bash scripts... running out of steam here I'm just going to list commands for a bit and then annotate later.&lt;br /&gt;
* this gets Ross' csv utilities with datapro plus a number of other things installed&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~/bin/&lt;br /&gt;
git clone https://github.com/rwspicer/csv_utilities.git&lt;br /&gt;
python ~/bin/csv_utilities/get_ip.py --infile=/home/scientist/extra/grayling_ip.txt --outfile=/home/scientist/grayling_ip&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* also need to configure ser2net:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo nano /etc/ser2net.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
* remove the existing lines at the bottom of the configuration and add this:&lt;br /&gt;
** specifying the port as ''7808''&lt;br /&gt;
** data type is '''''raw''''' ''(default is telnet)''&lt;br /&gt;
** serial to usb device is ''/dev/ttyUSB0''&lt;br /&gt;
** speed and data information (this is standard of most of our serial things though the baud rate may change depending on application): ''115200 8DATABITS NONE 1STOPBIT''&lt;br /&gt;
** a few additional parameters to close the connection and reset the radio after each use: '' HANGUP_WHEN_DONE RTSCTS LOCAL''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# IARC radio&lt;br /&gt;
7808:raw:25:/dev/ttyUSB0:115200 8DATABITS NONE 1STOPBIT HANGUP_WHEN_DONE RTSCTS LOCAL&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* now, reload ser2net daemon with new configuration:&lt;br /&gt;
&amp;lt;pre&amp;gt;service ser2net restart&amp;lt;/pre&amp;gt;&lt;br /&gt;
* next, test your setup:&lt;br /&gt;
&amp;lt;pre&amp;gt; telnet localhost 7808&amp;lt;/pre&amp;gt;&lt;br /&gt;
** then hit enter a bunch and watch for a reply from the data logger.  If you see it, awesome. to close the program, hold down the control key and press the close bracket key.  This will bring up a new prompt:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;CONTROL&amp;gt;&amp;lt;]&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
** then:&lt;br /&gt;
&amp;lt;pre&amp;gt;close&amp;lt;/pre&amp;gt;&lt;br /&gt;
* if that works, fantastic.  If that doesn't, try connecting directly to the serial port using ''screen'':&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo screen /dev/ttyUSB0 9600&amp;lt;/pre&amp;gt;&lt;br /&gt;
** If that works, awesome!  To quit screen then enter:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;CONTROL&amp;gt; - &amp;lt;A&amp;gt;  (press and hold control, then press A)&lt;br /&gt;
&amp;lt;COLON&amp;gt;&lt;br /&gt;
&amp;lt;TYPE&amp;gt; quit &amp;lt;/TYPE&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* if that works, then you have a good serial connection and may just need to tweak the ser2net configuration.&lt;br /&gt;
** I just noticed here that &amp;lt;pre&amp;gt;service ser2net restart&amp;lt;/pre&amp;gt; didn't properly reload the configuration file.  However this did:&lt;br /&gt;
&amp;lt;pre&amp;gt;service ser2net stop&lt;br /&gt;
service ser2net start&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Yet to come===&lt;br /&gt;
So, at this point you have a solid serial server.  There is often more functionality you can add though depending on how things go.  For instance, the speed test bash script may need to be installed, there might be webcam&lt;br /&gt;
===Intel Nucs===&lt;br /&gt;
====BIOS Fixes====&lt;br /&gt;
* Power screen&lt;br /&gt;
** Secondary Power Settings:&lt;br /&gt;
*** After Power failure Power On&lt;br /&gt;
*** Wake System from S5&lt;br /&gt;
*****Wake daily &lt;br /&gt;
* Boot&lt;br /&gt;
** Boot Configureation&lt;br /&gt;
*** UEFI Boot OS Selection Linux&lt;br /&gt;
** Secure Boot&lt;br /&gt;
*** Secure Boot Disabled&lt;br /&gt;
* Devices and Peripherals&lt;br /&gt;
** Onboard Devices&lt;br /&gt;
*** Audio Disabled&lt;br /&gt;
*** HD-Audio Disabled&lt;br /&gt;
*** Microphone Disabled&lt;br /&gt;
*** WLAN Disabled&lt;br /&gt;
*** Bluetooth Disabled&lt;br /&gt;
** Legacy Device Configuration&lt;br /&gt;
*** Enhanced Consumer IR Disabled&lt;br /&gt;
*** HDMI CEC Control Disabled&lt;/div&gt;</summary>
		<author><name>172.20.235.108</name></author>
		
	</entry>
</feed>