Sunday, July 6, 2014

Accessing SMB (CIFS) Shares From Linux

A long-standard means of accessing shared files on a network has been through the use of Server Message Block protocol or SMB shares.  Now referred to as Common Internet File System or "CIFS", it provides a way for client workstations to share files with each other or access files from a central server. Security can be assigned at a share level to determine which individual or group of individuals may access the files.

Configuring CIFS shares is beyond the scope of this post, but you can learn more about setting up CIFS shares on both Linux and Windows by following the links below:

The Easy Way In Linux
Using Group Policy To Create Shares In Windows

Linux utilizes libraries developed through a project called "Samba".  You can find more information on Samba here.

Connecting to CIFS shares is vital for me at work. We store EVERYTHING on our server from customer documentation, downloaded utilities and applications, ISO images and even full computer images.  Without access to these important files, I might as well not bother coming to work at all!

Let's assume for now that I enjoy my job and therefore need a means to access these files from my Linux laptop.  Ubuntu makes it crazy-easy to do through it's native file browser. Opening the application, previously known as "Nautilus" but now simply labeled 'Files' (never would have guessed that, eh?), there is an option in the left panel for 'Network'.  This will populate the content pane with any CIFS servers it finds.

Clicking on any of the servers will provide a prompt to enter username, password and domain information.  (Following my previous post regarding joining a Linux machine to a Windows domain will allow the user to by-pass this step for domain servers!) You can also choose whether to remember those credentials for future connections or forget them right away.

Once connected, I find it best to create a 'Bookmark' to some common locations. These are the rough equivalent of mapped drives in Windows; a method to return to shared locations easily and uniformly.  To bookmark the location you've just accessed, Hit "Ctrl+D" or drop down the 'Bookmarks" menu and select "Bookmark this location".  The bookmark will then appear in the left pane making it very simple to go back to the share in the future.

There are many ways to access CIFS shares from Ubuntu and other Linux distros.  If you aren't using Ubuntu, you may need to install the 'cifs-utils' package from your distribution's repository.  Additional tools might be required as well such as 'samba-common'.

A more dangerous method of accessing CIFS shares is to "mount" them through fstab.  Although Ubuntu mounts the CIFS shares automagically when you access them through Files, in my opinion it does it more safely than having them mount at boot with fstab.  To learn more about mounting CIFS shares through fstab and command line, follow this link.

Hopefully this has been helpful to you and look for more posts in the future!

Saturday, September 7, 2013

Remmina: A Windows Admin's Must-Have App


Microsoft Tools Not On Linux
  Using Linux to administer Windows machines is not impossible, in fact, it's quite do-able.  Although Windows-native interfaces like MMC, PowerShell, and VB don't exist in the Linux world, with some help from RDP, it's easy to use a remote Windows machine when these utilities are required either locally or to connect using one of these tools to another remote machine.
 
RDP to Windows Servers
 At some point a Windows Admin has to RDP to a remote Windows Server. Whether it's to check event logs, troubleshoot an unresponsive service, add applications, or just reboot the thing! There are a number of available RDP clients for Linux, including rdesktop and 2X Client. These pieces of software both have their upsides and downsides.

 For example, rdesktop is a terminal-based application for connecting to remote RDP servers. It can be difficult to use if you similar to Microsoft's client.  The script is called 'mstsc' and it contains the following:
aren't accustomed to the command line. For one-off connections, I use a short
rdesktop on Ubuntu
script to run rdesktop with a good default display geometry and syntax
 
#!/bin/bash
rdesktop -g 1024x768 -a 16 $1

 This way, I can use the syntax:

./mstsc <ServerName or IP>

 Similarly to how the Windows RDP client is executed (without the /v).  This provides a quick, command-line method for accessing remote machines on an ad-hoc basis.

GRDesktop is a GUI for
rdesktop in GNOME.
 There are GUI front-ends for rdesktop and, in fact, many of the RDP clients you'll find are mearly GUI front-ends for rdesktop. (like "GRDesktop", a Gnome front-end for rdesktop.)


 2X Client is a proprietary program designed to work with commercial 2X application server products, though standard RDP is also supported. The client is free (as in beer) and they have packages for popular distributions.



 Of the RDP clients I've used, the one I've stuck with is called Remmina. Remmina is a GUI frontend for FreeRDPFreeRDP is simply a fork of rdesktop (see?!).  It's been around for a few years now and comes along with Debian and Ubuntu in their repos, so it's super easy to install.  Just use aptitude:

sudo aptitude

 or apt-get

sudo apt-get install remmina

or Ubuntu Software Center.

Install Remmina from Ubuntu Software Center


mRemote Console


   Before I migrated to Ubuntu Linux for my work machine, I had been using Windows 7 and 8. In Windows 7, there was a nice little application I used to connect to remote servers called mRemotemRemote was a console that the user could add RDP, VNC, ssh, https, and other connections to in order to remotely access systems.





  The ability to create https connections was a point of particular awesomeness for me.  Why?  My company also used LogMeIn in order to access machines behind firewalls we didn't control. Back then, LogMeIn still allowed for an admin to create a shortcut that would connect them directly to the host without having to go through the website.  An admin could copy the URL from the shortcut and add it to mRemote as an https connection and viola!  All servers, no matter what method was used to connect to them, were available to me in the console.
https support was helpful for use with LogMeIn



 After moving to Ubuntu, I tried running mRemote in Wine without success.  The application was long since abandoned by the developer so there was no hope of support being written in.  While searching for an alternative, Remmina was suggested.

 Remmina is the closest thing to mRemote I've seen on Linux.  You can add connections to the console for remote protocols like RDP, VNC, ssh, and NX.  The remote protocols are supported via plug-ins, so, theoretically, other protocols (like https, perhaps?!) can be added if an enterprising programmer decided to write it.  Although, LogMeIn has since removed the ability to create shortcuts from its 'Free' accounts, so it's not really as important to me anymore...

  Still...

Moving from mRemote to Remmina
 Moving from mRemote to Remmina was made simpler for me through the use of a handy script I found (and unfortunately, can't remember who wrote!) that actually takes the XML from mRemote and converts it to Remmina connection files.  Brilliant!  It's not 100% effective, mind you.  None of the stored credentials made the transition and the display settings have to be changed, but just having all the host names and client names automatically come over was a big help for me!

 Using Remmina is really easy.  I have it configured through Ubuntu's "Startup Applications" to run at startup.  It loads up to the top toolbar panel and provides an easy-to-use drop-down menu of all the configured groups and connections in the application.  One click to drop the menu, one click to connect.  Done and done.  You're on your remote server doing what you need to do.

  In practice, I have had an issue with the menu where it scrolls off the screen without providing scroll handles, but if I click away and re-open the menu, it fixes itself.  I've also had occasional lock-ups, particularly when using multiple tabs with multiple protocols.  It doesn't happen often enough to really impact my ability to work, so it's not a problem for me, and the convenience the program provides far outweighs the inconvenience of the occasional lock-up IMHO.

 Have you used Remmina or another RDP client in Linux?  Which are your favorite?  Leave your comments and let me know!

Monday, September 2, 2013

Connecting (Ubuntu) Linux to Windows Active Directory for Authentication

Linux Authentication Against Windows?  Why not!

Why Bother?

  When approaching the possibility of using Linux to administer Windows networks, the very first aspect I felt needed to be addressed was the ability to authenticate my workstation against our company's Active Directory and hopefully, integrate this authentication with the local computer's log on process.  By integrating the log on, I knew that the workstation would be able to access our network's resources at start-up without any additional set up or scripting.  This would make it simple to get to shared client files, work in shared locations on our network with co-workers that are using Windows, and to keep the log on uniform across other network services.

LikeWise Open vs. Other Solutions 

LikeWise Open: Simple and free!
Searching around the Internet provided the answer I used on my workstation: LikeWise Open, the open-source version of LikeWise Enterprise.  LikeWise Open is one of a handful of solutions for connecting a Linux workstation to an Active Directory domain for authentication.  I chose it because the steps in Ubuntu seemed simple to follow and, well, I like simple! (Your distro's package repo may have it, it may not, just check!)

So, here's what I did:

Using Ubuntu's help page for Likewise Open on 10.04, I installed Likewise Open from apt using the following command in a terminal window:
sudo apt-get install likewise-open
Or click here to install via Software Center
Once installed, you can use it's "domainjoin-cli" command to join the workstation to your Windows domain.  Now, as a Windows Admin, you should already be aware of some needed information and configuration that has to be done before a workstation can successfully join a Windows domain.  These include:
  • Have the Windows DNS server configured as the primary domain server for your workstation. This is normally accomplished via DHCP, otherwise configure statically as needed.
  • Have the FQDN of the domain you are looking to join (ex. domain.local).
  • Have an account with permission to join workstations to the domain.
  • You may specify an OU during the join process, as needed, have the name of the OU handy.
 The syntax of the command is as follows:
sudo domainjoin-cli join [--ou <NameOfOU>] domain.local <UserAccount>
 In this example, domain.local is the FQDN for my domain, and <UserAccount> would be replaced by the account with permission to join the domain. You should be prompted for a password to complete the join process.

 Once the join completes, the system will need to restart to allow the machine to log on.  Once the reboot completes, the workstation will be able to authenticate with the domain by entering the username and password in the following format:
DOMAIN\<UserName>
Here, the "DOMAIN" is the NetBIOS name of your domain. After logging in, your workstation is now authenticated against the domain and can access resources just like a Windows client!  SMB shares, printers, LDAP queries, Exchange Mailboxes, etc.

Single Sign-On is Simple!

For any Windows admin, this is an important first step in integrating their Linux workstation with their network for the same, easy, single-sign-on access to network resources that they enjoy from Windows.

For more information, including video tutorials and alternate products, follow the links below:


Please feel free to use the comments section below or our Google+ Page to share other methods or tips for configuring Linux workstations for Active Directory.

Note:  LikeWise Open is now BeyondTrust PowerBroker Identity Services Open. However, the Ubuntu Community Forums are saying the apt repos still refer to the package as likewise-open as stated above so these instructions should still work,  likewise-open is no longer available in the repos.

Tuesday, August 27, 2013

Welcome!

Linux can administer Windows!
Greetings and welcome to the Linux for Windows Admins blog.  The goal of this blog will be to address various needs that Windows admins have on a day-to-day basis using FOSS/Linux solutions to administer their networks.

I work full-time as a Network Consultant for a variety of small businesses from dentist offices and HVAC dealers to CAD shops and law firms.  The one unifying factor to all these networks is that they are exclusively Windows-based.  Every customer uses some flavor of Windows Standard or Small Business Server and all the client PCs use Windows operating systems (save for a handful of MAC systems and WYSE terminals).

Dell Latitude E4310
About 8 or 9 months ago, I decided to ditch Windows 8 in favor of Ubuntu Linux 12.10.  I use a Dell Latitude E4310 which has a fairly standard batch of hardware, though it was a touch on the newer side. Installing Ubuntu Linux was a breeze with the exception of the graphics and wireless drivers.  With a bit of research and a custom driver repository, I was up and running.

At first, the goal was to simply see if I could do it:  Could I effectively administrator dozens of Windows-based small business networks from a Linux laptop?

Surprisingly (or maybe not so), the answer has been a resounding 'Yes!'.
It works!

Of course, I have had to do my fair share of research and investigation along the way in order to get fully up-and-running.  There are a plethora of unique scenarios a small business sysadmin encounters and finding not only the right solution, but a solution that would also work in Linux has sometimes been a challenge. But, hey, it makes it that much sweeter when it's all working just the way you like it.

I hope you find value in what I post and maybe even have a little fun along the way.  Enjoy!