All posts by bsdman

Currently working as an IT Manager. Worked for an OIT company as a Network Engineer in 2011. Worked for a Medical IT company as the Network Administrator 2009-2011. Worked as the Senior Systems Administrator at a computer reseller from 2005-2009. Worked as a Computer Consultant for several small companies from 2007-2009. Worked as a Computer Technician at a computer reseller from 2002-2004.

Upgrade NAS4Free Firmware

I had NAS4Free server version x64_9.0.0.1.188 installed on a server and wanted to upgrade it to the latest version before moving into production.

I’m assuming you already have a ZFS (or other filesystem) share mounted on the server. And that SSH is enabled.

Copy the file to your share – I used WinSCP as it 1.) works and 2.) is free and 3.) I’m used to it.
SSH to the NAS and run the following:
/etc/rc.firmware enable
/etc/rc.firmware upgrade /path/to/img/file.img

The server will then reboot and you’ll be running the newest version.

ZFS tuning on freenas nas4free – I’ll split this out eventually.
http://forums.nas4free.org/viewtopic.php?f=55&t=26
# mkdir /mnt/data/zfskerntune
# cd /mnt/data/zfskerntune
# fetch http://www.kav91.com/nas4free/zfskerntune-20111022-nas4freeKav91.tar.gz
# tar xvf zfskerntune-20111022-nas4freeKav91.tar.gz
# cd zfskerntune
# ./zfskerntune-install.php

C$ From Domain Computer to Non-Domain Errors

I had a user with administrative permissions added onto a server 2008 system (on a workgroup) that could not map out the c$ admin share. I’m not sure of the exact error now since I’m writing this up about a month after the fact, but I found the fix.

Win7 client on domain connecting to win2k8 server on workgroup. Did the \username with password, still no dice. Registry fix fixed issue.

Download File
EnableCShare.reg

Install File

Wait about 30 seconds

Attempt C$ again

Obviously check ALL registry files BEFORE importing onto your system. Just in case someone tries to pull your leg.

Ubuntu BIND Webmin NXDOMAIN

I had setup two BIND9 servers on ubuntu to service all VPN connected users. They were both linked just fine. I managed BIND via webmin installed.

A linux user and a Mac user were connecting to the VPN and then finding they could no longer connect to any web sites outside of the DNS domain.

nslookup google.com
;; Got recursion not available from 10.10.5.60, trying next server
Server: 10.10.5.61
Address: 10.10.5.61#53
** server can’t find google.com: NXDOMAIN

Well that’s no good. First server isn’t allowing recursive connections and the second one is not forwarding properly. I checked webmin and saw in the forwarding and transfers section that I had, indeed, already added 8.8.8.8, 8.8.4.4, 4.2.2.2, and 10.10.5.70 (internal DNS). So why was it not working?

Fired up putty and SSH’d in
nano /etc/bind/named.conf.options
Under the options { area add the following:
allow-query { any; };
allow-recursion { any; };
Save and quit

Reload Bind
/etc/init.d/bind9 reload

Profit

USB Drive Missing Space

I had formatted a usb flash drive to be a linux boot disk. Then, when finished, I went to reformat the drive and was only prompted to format 168MB out of the 1GB it originally had.

Open up the command line and type in the following:
disk part
list disk
select disk YOURDISKNUMBER
clean

After cleaning, you should be able to right-click and format again with the full amount of space. You can also finish this up using command line:
create partition primary
select partition 1
active
format fs=fat32 quick
assign
exit

Admin Share Windows 7 Server 2008

If the Windows 7 or Server 2008 (even R2) is not in a domain but in a workgroup, you may have administrative issues trying to access C$ etc.

Google found me this:
http://blog.hansmelis.be/2009/09/06/administrative-shares-in-windows-7/

A simple registry change and away you go. You do not have to reboot, but after the change you might have to wait up to a few minutes for it to work.

Those who have experience with NT-based operating systems on a network will certainly be familiar with the concept of administrative shares. If that doesn’t ring a bell, you access them like \\computername\c$. With this intro and the title of this post, you might be alarmed or enter panick mode fearing they might be gone in Microsoft’s latest OS iteration. Well don’t go into cardiac arrest because they are still there… but of course not without the odd problem.

Windows 7 still creates the administrative shares on install, but you can’t use them out of the box. First of all, you need to have File and Printer Sharing enabled. And the way to do that has once again been changed:

Open the control panel.
Go to Network and Internet.
Go to Network and Sharing Center.
In the left column, click on Change advanced sharing settings.
There are two profiles. You probably don’t want this on when you’re on a public network so open Home or Work.
Under the header File and Printer sharing, select the Turn on… option.

And now your administrative shares still don’t work 😛 You’ve just completed step 1 which implies there’s at least a step 2 and here it is: you also need to change the registry.

Click on the orb (= the round button with the Windows logo in the taskbar) and type regedit in the search box.
Open the registry editor.
Navigate all the way to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System.
Right-click in the pane on the right side and add a new DWORD (32-bit).
Give the new setting the name LocalAccountTokenFilterPolicy.
Double click on that setting and give it a value of 1.

It’s probably wise to reboot after doing this, although it might not be needed. I’m not sure if it works straight away because I rebooted without trying.

Anyways, if you’re lucky you will be able to access administrative shares after performing these steps. If you’re unlucky, like me, doing all these things appears to have zero effect at all. Once again don’t panick, because there’s another hint/tip/solution coming your way.

Somewhere at some point during the installation or configuration of Windows 7, you will be asked to do something with a thing called Homegroup. It’s some weird new sharing tool that looks OK but isn’t quite what you’re used to. Once you have enabled that feature, you won’t be able to use the administrative shares. So the tip is: disable the homegroup feature.

Open the control panel.
Go to Network and Internet.
Go to HomeGroup.
Click on the blue link Leave the homegroup.

The popup dialog should point out itself, but I believe I picked to first option. Once I had left the homegroup, the administrative shares started working again.

I hope this post can help anyone who experiences the same problem.

Owncloud 4 and AD LDAP

I recently migrated from owncloud 3 to owncloud 4 for a few of the newest features (versioning, security, working ldap).

LDAP configuration
LDAP Basic
Host: IP or Resolvable DNS
Base: dc=DOMAIN,dc=TLD
Name: user@domain.tld
Password: password
User Login Filter: sAMAccountName=%uid
User List Filter: objectClass=user
Group Filter objectClass=group

Advanced
Port: 389
Case insensitive LDAP server checked
Display Name Field: sAMAccountName

Change Timezone Linux CLI

I had a security-onion box running and it defaults to UTC/GMT time.  This was fine for me as I could do the subtraction of time in my head, but for some in management they were questioning my findings due to the time being off.  So, to make my life easier, I decided to change the timezone.

The timezone under Linux is set by a symbolic link from /etc/localtime to a file in the /usr/share/zoneinfo directory that corresponds with what timezone you are in. For example, since I’m in Chicago, /etc/localtime is a symlink to /usr/share/zoneinfo/America/Chicago. To set this link, type:

ln -sf /usr/share/zoneinfo/your/zone /etc/localtime

http://www.linuxsa.org.au/tips/time.html