Home systems: Difference between revisions

From SoftwareGuy
Jump to navigation Jump to search
Mark (talk | contribs)
No edit summary
Mark (talk | contribs)
Line 173: Line 173:
  ssh-keygen
  ssh-keygen
  ssh-copy-id -i ~/.ssh/id_rsa.pub mhamilton@msgsb.com
  ssh-copy-id -i ~/.ssh/id_rsa.pub mhamilton@msgsb.com
== Latest sshd configuration changes as of ubuntu 22.04.03 lts ==
In /etc/ssh/sshd_config change the following lines as shown:
<code>PubkeyAuthentication yes
PubkeyAcceptedKeyTypes=+ssh-rsa</code>
Then restart sshd
<code>sudo systemctl restart sshd</code>


----
----
[[Main_Page]] Main
[[Main_Page]] Main

Revision as of 14:37, 9 February 2024

This doc contains the things I've found I need to update to get my linux2 server working.

Changing default serial port protections

create a file, such as <code>99-local.rules</code> in the following directory: <code>/etc/udev/rules.d/</code> with the following info:

<pre>

  1. Give world read/write access to ttyS* and ttyUSB* serial devices

KERNEL=="tty[A-Z]*", GROUP="uucp", MODE="0666" </pre>

Ubuntu dual monitors

Run <code>nvidia-settings</code>. Now we may need to modify the Xconf file, if so see the following:

  1. Open nvidia-settings by searching for nvidia in the Dash, or run the command gksudo nvidia-settings in the Terminal. Note not to press the apply button.
  2. Under 'Xserver Display Configuration' select TwinView and configure the settings for the monitors to your liking.
  3. Click 'Save to X Configuration File' and an error message should appear. Click OK.
  4. In the next dialog box click the button to 'Show Preview'.
  5. Leave the preview window open and open a Terminal. Run the following commands in the Terminal to back up your xorg.conf file and open the original file in a test editor. If something goes wrong, just revert to your backed up xorg.conf.
  6. sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.bak
  7. gksudo gedit /etc/X11/xorg.conf`
  8. Copy the text from the nvidia-settings preview window into the xorg.conf file. Save the xorg.conf file and close gedit. Click 'Cancel' to close the nvidia-settings preview window. Then click 'Quit' to exit completely out of nvidia-settings without applying or saving any data.
  9. Restart your computer. If all went well, the two monitors should work together.

Note: As of ubuntu 12.04 you don't appear to need to copy the xorg.conf files around. Just clicking save is all it takes.

Rebuilding Raid

Rebuilding a raid system?

Detail from mdadm of good working file system prior to zeroing the superblock.

<pre> sudo mdadm --detail /dev/md4 /dev/md4:

       Version : 0.90
 Creation Time : Sat Mar 19 08:02:27 2011
    Raid Level : raid6
    Array Size : 160649856 (153.21 GiB 164.51 GB)
 Used Dev Size : 80324928 (76.60 GiB 82.25 GB)
  Raid Devices : 4
 Total Devices : 4

Preferred Minor : 4

   Persistence : Superblock is persistent
   Update Time : Sun Jun  3 21:06:27 2012
         State : clean 
Active Devices : 4

Working Devices : 4

Failed Devices : 0
 Spare Devices : 0
        Layout : left-symmetric
    Chunk Size : 64K
          UUID : b60f9401:efa1275e:6caba8f0:d8b2a7d7
        Events : 0.457
   Number   Major   Minor   RaidDevice State
      0       8       66        0      active sync   /dev/sde2
      1       8       82        1      active sync   /dev/sdf2
      2       8       98        2      active sync   /dev/sdg2
      3       8       50        3      active sync   /dev/sdd2

</pre>

Note, the drive order is very important. Also, remove the ARRAY entry from /etc/mdadm/mdadm.conf for the drive.

<pre> sudo mdadm --stop /dev/md6 sudo mdadm --zero-superblock /dev/sd[defg]2 sudo mdadm --create /dev/md6 --metadata=1.0 --chunk=64 --level=6 --raid-devices=4 /dev/sde2 /dev/sdf2 /dev/sdg2 /dev/sdd2 </pre>

Ok, now we need to get the blkid from the md filesystem and add an entry into the mdadm.conf file which matches.

<pre> sudo blkid /dev/md6 # edit mdadm.conf file and add entry "ARRAY /dev/md6 UUID=dad67a5c:0907045c:7eb49ca0:d0f6f000" sudo mdadm --assemble /dev/md6 --update=resync sudo mdadm --detail /dev/md6 sudo blkid /dev/md6 sudo mount -t ext3 /dev/md6 /mnt/temp

watch -n 1 cat /proc/mdstat </pre>

or... ???

<pre> sudo mdadm --stop /dev/md6 sudo mdadm --zero-superblock /dev/sd[defg]2 sudo mdadm --create /dev/md6 --metadata=0.9 --chunk=64 --level=6 --raid-devices=4 /dev/sde2 /dev/sdf2 /dev/sdg2 /dev/sdd2 sudo mdadm --assemble /dev/md6 --update=resync sudo mdadm --detail /dev/md6 sudo blkid /dev/md6 sudo mount -t ext3 /dev/md6 /mnt/temp </pre>

If this is a new raid drive, make the filesystem then mount

<pre> sudo mkfs /dev/md6 sudo mount /dev/md6 /mnt/temp </pre>

Fixing mail permission errors on linux2

Do the following: <pre> sudo touch /var/mail/$USER sudo chown $USER:mail /var/mail/$USER sudo chmod o-r /var/mail/$USER sudo chmod g+rw /var/mail/$USER </pre>

Updates to tzo configuration

After installing tzo I needed to update the <code>tzod</code> script in <code>/etc/init.d</code>. I updated the following script segment to look like this (basically just added the lines with <code>/lib/lsb...</code>: <pre> if [ -f /etc/rc.d/init.d/functions ]; then

       . /etc/rc.d/init.d/functions

elif [ -f /etc/init.d/functions ] ; then

       . /etc/init.d/functions

elif [ -f /lib/lsb/init-functions ] ; then

   . /lib/lsb/init-functions

else </pre>

Next I added a soft link in the <code>/etc/rc.5.d/</code> directory: <pre> sudo ln -s ../init.d/tzod S99tzod </pre>


Trick for port forwarding

This lets me access the CUPS system on the linux2 server from my linux laptop. Issue this command on the laptop, insert the appropriate passwords...

<pre> ssh -L 6310:localhost:631 root@remote_ip_address </pre>

Now access the cups system via the browser on the laptop by going to <code>localhost:6310</code>.


Making movies from jpg files

This seems to work...

<pre> mencoder -ovc copy -mf w=320:h=240:fps=12:type=jpg "mf://*.jpg" -o output.avi mencoder -ovc copy -mf w=320:h=240:fps=12:type=jpg "mf://@list.txt" -o output.avi </pre>

Raspberry pi serial port

http://www.raspberrypi.org/forums/viewtopic.php?&t=27035

Backing up the server

Run the following command on the desktop which has the backup disk mounted. This will backup /home to the backup drive, and this command should be repeated for each filesystem on linux server. rsync is now enabled on the msgsb.com server.

rsync -avzH linux2:/home2 /media/mhamilton/Seagate\ Backup\ Plus\ Drive/home2/

Also this can be run on the pi at the condo. Login to the condo pi and run the following commands:

ssh pi@h-condo.dyndns.org
rsync -avzh mhamilton@msgsb.com:/home3 /backup-msgsb/home3

To setup ssh to not query for passwords, from the pi:

ssh-keygen
ssh-copy-id -i ~/.ssh/id_rsa.pub mhamilton@msgsb.com

Latest sshd configuration changes as of ubuntu 22.04.03 lts

In /etc/ssh/sshd_config change the following lines as shown:

PubkeyAuthentication yes PubkeyAcceptedKeyTypes=+ssh-rsa

Then restart sshd

sudo systemctl restart sshd


Main_Page Main