kdmurray.blog

The crossroads of life and tech

Ubuntu School – Add an Existing User to a Group

Occasionally you need to grant an existing user some additional permissions to files, directories or applications. This typically means some kind of change in your permissions settings for the object in question. But because you can only have a single owner for a given object you need to be careful making these changes.

Something you can do, though, is extend the permissions on the object to a set of users by way of a group. Logically, a group is nothing more than a named collection of users who all have the same access (by way of that group) to some resource. Users in Ubuntu typically carry one primary, and one or more secondary groups (I won’t get into the differences here).

By adding group permissions to your resources (ie give the ‘payroll’ group read/write access to the ‘HR’ folder) you can simply add users to and remove users from the appropriate groups and be confident that their level of access to the resources on your machine is set correctly.

To add an existing user to an existing group:

sudo usermod -a -G payroll graymond

To remove a user from a group you use the same command. The catch is, you remove a user from a group by re-adding all of their groups and simply omitting the group you wish to remove them from.

sudo usermod -nG mkirkpatrick

The system will show you a list of the user’s groups.

marketing sales vanprinters torprinters

Then you simply run the usermod command as above, removing the group in question (in this case vanprinters)

usermod -G marketing,sales,torprinters mkirkpatrick

Email Consolidation with Gmail

What is it

This article was inspired by an episode of the Mac Power Users podcast talking about strategies to manage email. With those tips in mind I set about carving out an email strategy that would help me get my multitude of email accounts down to a reasonably dull roar.

The concept is simple. The fewer mailboxes you have to check, the simpler checking email becomes. It can also be easier to answer the question “what’s your email address” when you don’t have so many to choose from.

This is admittedly a problem that only a relatively small subset of people will have. There are always going to be people out there who only have a single email address and who would never need to read through this article because one is about as consolidated as you can get.

This series will get into a fair bit of detail on what features of Google’s email service best serve these needs, and how you can put these things to work for you.

Why would I do this?!

To illustrate, a parable:

Bill was a busy man. He would spend his time every Saturday going from bank to bank moving money and paying bills. He had accounts at many different banks. His reasons were as varied as the banks and the accounts themselves, but each of them had add perfect sense at the time.

He had a chequing account with a bank that was partnered with his employer, that’s where his pay was deposited. He had a savings account with a bank he’d been with since he had his first job 15 years ago. He had a joint account with his wife at another bank which was partnered with her employer (where her pay was deposited) and an account with another bank that held his mortgage. While each individual account was in and of itself a good idea, and seemed wise at the time, all of Bill’s Saturdays were sing consumed with trying to manage and move money between his various institutions.

Bill could save a lot of time and energy by replacing some or all of these accounts with single account. In short, consolidate. By having his pay and his wife’s pay deposited into the account that their mortgage is drawn from it would greatly reduce the complexity of his life – and might even open up a few hours on Saturday to do something more important.

That story should sere to illustrate my point, but in case it wasn’t clear, let me be blunt. Shutdown and if necessary re=point your old email addresses to a new single collection point. Instead of bouncing around between who-knows-how-many different email inboxes, you can manage everything from Gmail or from one of the client solutions that ties into Gmail’s IMAP services.

It sounds like a lot of work

It is. I won’t sugar-coat the truth by pretending this is something you’ll get done in 10–15 minutes. You won’t. If you’re still interested, Here’s how I went about it:

1. Identify accounts to kill

The first step in the process is to figure out just what needs to be cut. Be ruthless. Any account that receives way too much spam should be considered to go on this list. Another good set of candidate accounts is those that only allow POP access. Many ISP accounts, and some free email accounts are set up like this. If you can eliminate your dependence on your ISP’s email account, you will eliminate a major barrier to leaving that ISP if you need to down the road.

2. Identify accounts to keep

If you already have a Gmail account it may be at the top of your to-keep list – assuming of course it’s not the one you’ve been using to sign up for every shiny new cloud service, I which case you may need to dump it. I also recommend keeping any important email addresses that you have, even if you don’t use the email service. I have an address from school which is useful for getting some student discounts. I’ll talk about how to handle this later.

Finally there’s the question of what to do with work and personal email. As far as I’m concerned the only thing to do is keep them separate. This is one case where mixing work and pleasure is not a good thing.

3. Identify accounts to create

This is a place to give some thought. If the stuff you’re keeping doesn’t fully fit the bill for the addresses you need you may need to create one or two. If you have your own domain, you may want to consolidate down to have your email addresses live there. This can add a sense of personality or style to the email addresses you use.

4. Map old to new

Decide which old addresses that you’re keeping need to flow into which of the mailboxes you’re keeping. This is an important distinction – you don’t have to keep the actual mailboxes for each of the addresses you want. For new addresses that are aliases, you may be able to do this from your domain hosting provider’s admin panel. For addresses that were formerly mailboxes you had been using it will involve some trickery. This is a step that helps to have some visual aids.

5. Import messages

In each of the new Gmail accounts that will be receiving messages from old addresses you need to setup mail import from the existing account using POP.

  1. Open your Gmail settings
  2. Select Accounts and Import
  3. In the section Check mail using POP3 click Add a POP3 account that you own
  4. Follow the prompts to configure that account

6. Forward old email accounts

If your email provider for the old account supports email forwarding you can set that up instead of using up one of your POP mail slots.

7. Tell your friends!

Once all of the configuration is done, you need to tell people about your shiny new address(es). Send emails out to all of your contacts who need to have your new addresses. Send these messages from the new accounts so that people who reply to the messages will already be using the new ones. And don’t forget to BCC everyone, please.

Ubuntu School – sudo Your Last Command

Sometimes we just forget that we need to specify elevated privileges on our Ubuntu machines. I do it all the time, particularly when I’m setting up a new machine.

Thankfully there’s a shortcut for those of us who are forgetful. If I want to restart the box I can use a command like:

shutdown -r now

But of course that command requires elevated privileges:

shutdown: Need to be root

With the fantastic !! argument for sudo you can repeat your last terminal command:

sudo !!

Now you can quickly and efficiently re-run that last command you forgot to sudo!!

Ubuntu School – DHCP Release and Renew

It’s not uncommon to need to release/renew the IP address for a given machine. This is particularly true if you’re doing any kind of maintenance on your network, or are troubleshooting pretty much any kind of Internet problem. I never seem to remember how to do this, so I’m including this post as much for my own benefit as anything.

What I’m talking about is the Ubuntu equivalent of these windows commands
ipconfig /release
ipconfig /renew

From an Ubuntu terminal type:
sudo dhclient -r
sudo dhclient

Much like the Windows equivalents you can also specify these actions for a specific interface if your situation requires.

sudo dhclient eth0

Synchronizing Google Contacts with iOS

For whatever reason setting up your Google account with your iOS device doesn’t allow you to synchronize your contacts. I suspect it has something to do with the limitations of IMAP, but nonetheless it’s a tad annoying. You can, however get your contacts synced up by setting up your Google account a second time as an exchange server. Google has (mostly) implemented the necessary pieces to allow it to appear to clients as a Microsoft Exchange server.

The server connection details are as follows:

  • Server: m.google.com
  • Username: user@googlemail.com (for @gmail.com addresses)
  • Username: user@mydomain.com (for Apps-for-domains addresses

Make sure that you don’t double sync your mail or calendars if you’re already using the built-in Google account support in iOS. If you don’t need notes, you could consider using the exchange-mode only to reduce the number of accounts on your device.

Ubuntu School – Creating a New User

There are two built-in commands for creating a user from the command-line in Ubuntu: useradd and adduser. useradd is the older command which has, for the most part, been deprecated in favour of the more user-friendly adduser command. Both will allow you to create new user accounts, set up home directories and generally move in the right direction, but adduser will prompt you for information you didn’t include whereas useradd will assume you didn’t want those things (ie create the home directory).

sudo adduser theboss

will produce an output similar to

Adding user `theboss' ...
Adding new group `theboss' (1001) ...
Adding new user `theboss' (1001) with group `theboss' ...
Creating home directory `/home/theboss' ...
Copying files from `/etc/skel' ...
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for theboss
Enter the new value, or press ENTER for the default
Full Name []: Joe Bossman
Room Number []:
Work Phone []:
Home Phone []:
Other []:
Is the information correct? [Y/n] y

And there you are! Happy user-creating!

Aussie Geek Podcast #51

It’s our first episode of 2012! Dave and I got together to go over the latest tech news from the past couple of weeks including some highlights from CES – oh wait, that’s everyone else on the ’net. We took a different tack this week and looked at waterpoofing, clotting and dropping iThings from space.Come check out the latest installment of the AGP!

Aussie Geek Podcast #50

The team put together another episode of the Geek before the holidays, this time out was a bit of a milestone for the crew. For AGP #50 we had some special guests on the line, namely Tim and James who have both been key players in the history of the show over the past 6 years.

We discuss our own individual histories of computing and how technology and computing have affected our lives, and the technology-tracks that our lives have taken over the past couple of decades.

XKPasswd – Generate Secure, Memorable Passwords

On the heels of Steve Gibson‘s Password Haystacks website, which demonstrated how long memorable passwords can be far more secure than randomly generated characters simply by virtue of being longer, Bart Busschots has created a new password generation tool called XKPassword.

The idea of the generator is along the same lines of the original generator posted on the GRC website, but has been done as an implementation example of Bart’s perl library xkpasswd — the “xk” being a reference to the xkcd comic which discussed the same subject around the same time as the Security Now episode talking about password haystacks.

The general theory behind haystacks is that you take an easy-to-remember password like monkey (or m0nk3y) and bury it an easy to remember, but very long “haystack” of other characters. The sheer length of the password makes it orders of magnitude harder to guess than the original password.

Example: !@#$1234-Monkey-1234!@#$ and just like that you have created a 24 character password with upper case, lower case, numbers and symbols which (if you look at it for a minute) is going to be really easy to remember — especially if you recycle the “haystack” portion and pair it with other simple words to create a multitude of never-have-to-write-em-down passwords.

So what about xkpasswd? Well the idea is this, the tool will generate for you a list of easy to remember words buried in a haystack of simple padding characters. He has also added a number of presets for things like an Apple ID, WPA2 wi-fi security key and web sites (short and long) in case you do not want to tweak the raft of available options.

It is a great little tool for generating passwords that adds some intelligence that you do not get from the typical random password generators like the ones built into LastPass, 1Password or SuperGenPass. I highly recommend you check out xkpasswd if you are looking to augment your password arsenal. If you are a developer, check out the library available from Bart’s website if you want to include this functionality in an application that you are developing.