Configuration LaCie-CloudBox: Difference between revisions

From miki
Jump to navigation Jump to search
Line 18: Line 18:
|lacie-cloudbox
|lacie-cloudbox
|}
|}

== Rooting ==
See {{file|/shares/Family/tmp/lacie-nas-rooting.txt}}.

=== Git ===
To enable git, we must:
* Enable git logging in {{file|/etc/passwd}}.
* Enable git ssh logging in {{file|/etc/ssh/sshd_config}}

The following scritp does this, and should be run at each boot. For now the script is at {{file|/root/RUNME_ON_BOOT.sh}}.

<source lang=bash>
#! /bin/bash

# Enable ssh logging with user git
sed -ri '/^git/{s_/home_/shares/git_; s_/bin/false_/opt/bin/git-shell_}' /etc/passwd
if ! grep -q git /etc/ssh/sshd_config; then sed -ri '/^AllowUsers/s/$/ git/;$aMatch User git' /etc/ssh/sshd_config; fi;

# Restart sshd
ngc --restart sshd

# Change permission for /shares/git or sshd will complain (or add 'StrictModes off to /etc/ssh/ssh_config)
chmod go-w /shares/git
</source>

;TODO
:Enable git automatically at each reboot


== Shares ==
== Shares ==

Revision as of 15:41, 21 June 2015

Install

  • Network share available at smb://lacie-cloudbox/.
  • Cloudbox dashboard available at http://lacie-cloudbox.local.
  • setup smtp access (smtp.scarlet.be, port 25)
  • IP Configuration — fixed IP address 172.19.100.98
  • Enable the netbackup-share (port 873, encrypted port 22)
  • Create user beq06659, with private share.
MAC 00:d0:4b:96:34:32
IP 172.19.100.98
hostname lacie-cloudbox

Rooting

See /shares/Family/tmp/lacie-nas-rooting.txt.

Git

To enable git, we must:

  • Enable git logging in /etc/passwd.
  • Enable git ssh logging in /etc/ssh/sshd_config

The following scritp does this, and should be run at each boot. For now the script is at /root/RUNME_ON_BOOT.sh.

#! /bin/bash

# Enable ssh logging with user git
sed -ri '/^git/{s_/home_/shares/git_; s_/bin/false_/opt/bin/git-shell_}' /etc/passwd
if ! grep -q git /etc/ssh/sshd_config; then sed -ri '/^AllowUsers/s/$/ git/;$aMatch User git' /etc/ssh/sshd_config; fi;

# Restart sshd
ngc --restart sshd

# Change permission for /shares/git or sshd will complain (or add 'StrictModes off to /etc/ssh/ssh_config)
chmod go-w /shares/git
TODO
Enable git automatically at each reboot

Shares

family
  • Mount with
sudo mount //lacie-cloudbox/beq06659 /mnt/any -o noperm,iocharset=utf8,sec=ntlm,username=public,password=


beq06659
  • Mount with
sudo mount //lacie-cloudbox/beq06659 /mnt/any -o noperm,iocharset=utf8,sec=ntlm,username=beq06659

Backup

  • Backup done with deja-dup, which use duplicity as back-end
  • Duplicity can't access samba share. Instead mount samba share locally, and use file:///smb/lacie-cloudbox/sharename instead. Note the triple slash.
  • View available backup:
duplicity collection-status file:///smb/lacie-cloudbox/beq06659
  • List file in current backup
duplicity list-current-files file:///smb/lacie-cloudbox/beq06659

Metadata information is stored in ~/.cache/duplicity. Attention, it seems this can grow quite large.

DHCP Server

  • DHCP daemon configuration: /opt/etc/dhcpd.conf
  • View current lease:
cat /opt/etc/dhcpd.leases

To do

  • Current backup only includes files that are readable by user beq06659. It should include all files.
  • Exclude some unnecessary folders. Organize these folders to ease future backup.
  • Backup / filesystem (at least /etc, /usr/local)
Backup solutions
  • deja-dup
  • Need one setup for each pc
  • No centralized management. Backup job could happen all at the same time. Same files between pc are stored multiple times.
  • Easy to setup
  • How to backup root filesystem?
  • duplicity
  • backuppc
  • How to install?
  • Will the NAS have enough memory?
  • bacula
  • Package readily available in OptWare
  • rsnapshot

See question on bacula/backuppc/rsnapshot at http://serverfault.com/questions/282228/bacula-vs-backuppc

Rooting NAS and install new app
  • TBC

Troubleshoot

sshd
  • See log at /var/log/messages
  • Check sshd config /etc/ssh/sshd_config:
  • Make sure user is authorized:
 AllowUsers root netbackup git
  • If user home is on /shares mount, then disable StrictModes
StrictModes no
  • Enable user environment
PermitUserEnvironment yes
then
env > ~/.ssh/environment
vi ~/.ssh/environment                # Remove useless variables
  • Edit /etc/passwd:
git:x:503:100:None:/shares/git:/opt/bin/git-shell
  • Restart sshd:
ngc --restart sshd
git
  • Check that environment is ok [1]
ssh git@lacie-cloudbox  "which git-upload-pack"