Linux – Setting Up FTP/SFTP Restricted Access for User

I run a server (Ubuntu 18.04) that hosts about a dozen websites using Linode. Most of the sites are run using WordPress and are my own or sites I manage for friends or family. I do, however, host one for a colleague who actively develops online content for that site.

As WordPress has developed, the ability to upload various file types has slowly been removed for security reasons. As a result, for certain types of files, it is now required to upload them using a different approach. I can do so using SSH, but GUI FTP/SFTP software was going to be easier in this situation as the person responsible for managing that site doesn’t have a lot of knowledge managing a website. I explained to this person, we’ll call her Sharon, that it would be possible for her to upload these files herself using FTP/SFTP. She was worried as she doesn’t know what that is or how to use it. But I explained it and, hopefully, she’ll grow more comfortable with it.

However, I don’t want a novice to gain access to all the files on my server. So, I was faced with the question of how to set up an FTP/SFTP account for someone that is restricted to just one folder – a folder where she can upload stuff and delete files, but with no access to anything else.

Here’s how I did it.

First, you should create a new user group on your server. This can be done with the following command:

sudo addgroup --system GROUPNAME

This will add a new user group called GROUPNAME (I called mine “ftpusers”). If this individual isn’t currently a user on your server, add them as a user as well:

sudo adduser --shell /bin/false USER

Replace “USER” with whatever name you’re using for this individual, for me it was “sharon.” You’ll need to create a password for your USER and fill in some additional information. Then add your USER to your GROUPNAME with the following command:

sudo usermod -a -G GROUPNAME USER

Or my command:

sudo usermod -a -G ftpusers sharon

So, you have now created a new group and a new user and added the new user to the new group. Of course, the next step is to restrict what your new USER can do. In particular, we want the user to have access to just a single directory. Here’s how that is done.

You can create a directory the user can use:

sudo mkdir -p /var/sftp/NEWFOLDER

This folder can be anywhere on your server. I put mine in a subfolder on their wordpress installation:

sudo mkdir -p /var/web/DOMAIN/public/wp-content/uploads/NEWFOLDER

Now, we need to tell the server to restrict USER to this NEWFOLDER when they login. First, let’s give ownership of that folder to the user with the chown command:

sudo chown USER:GROUPNAME /var/sftp/NEWFOLDER

We should also make sure the permissions for the new folder are what we want them to be – read/write for the user and group:

sudo chmod 755 /var/sftp/NEWFOLDER

If you navigate to that folder and check the settings, you should see that the owner is now the USER and the GROUPNAME (you can check with “ls -l”). It’s not a bad idea to also check to make sure that the folder above it is owned by “root” or your primary user, which will prevent your new USER from being able to make changes to that folder.

So far, we have a new USER and GROUPNAME and the user has a folder they can access. However, we need to tell the server that the user needs SFTP access and then need to force them to go to just that one folder when they login with SFTP.

To grant them SFTP access, you need to change the SSH settings:

sudo nano /etc/ssh/sshd_config

This will open the file “sshd_config” with a text editor (nano) so you can make changes. At the end of the file, you want to add the following text:

ForceCommand internal-sftp
PasswordAuthentication yes
ChrootDirectory /var/sftp/NEWFOLDER
PermitTunnel no
AllowAgentForwarding no
AllowTcpForwarding no
X11Forwarding no

This allows users in the group GROUPNAME SFTP access to the folder you created for them.

Before you close the nano session with “sshd_config”, you may have to change one other setting. Look for a line that says:

Subsystem sftp /usr/lib/openssh/sftp-server

Mine was not commented out, so that setting was active. However, given the settings we just added to the file, we need to change that. Comment out that line:

#Subsystem sftp /usr/lib/openssh/sftp-server

Below that line, add the following line:

Subsystem sftp internal-sftp

I’m guessing that the original line specified a location for the sftp-server to be used by the server but we want the server to determine the best location for the sftp-server it is going to use and that’s what the second line does. (Alternatively, in the text added to “sshd_config” the line “ForceCommand internal-sftp” could probably be left off, meaning you wouldn’t have to do the step I just described. I haven’t tried that, but it may work.)

Anyway, when you’re done editing the “sshd_config” file, save it and exit from nano.

Finally, to make sure that the new USER is forced into the specified folder when they login, you have to make one more change. This changes the home directory for the user so they are forced into that directory when they login. Here’s the command.

usermod -d /var/sftp/NEWFOLDER USER

This makes the folder you created (NEWFOLDER) the home directory for the USER so, when they log in using SFTP, they will be forced directly into that folder.

There you have it. You have a new user in a group with restricted SFTP access and the user will be forced directly into the folder you created where they can upload, modify, and delete content. They will not have access to anything else on the server, so the rest of your content will be safe.

Acknowledgments: I figured all of the above out with help from these sites: here, here, here, and here.

 1,108 total views,  1 views today

Virtual Private Hosting – How to Remove a Domain with Certbot SSL Certificate (on Ubuntu 16.04 with apache)

It used to be pretty easy to remove a domain from my Virtual Private Server – dissable the site in apache, delete the files, delete the underlying database, and remove the domain from my DNS manager. Done.

With SSL certificates now a standard part of hosting websites (see here), this is complicated by the removal of those certificates. I am extremely grateful to the EFF for providing a free way to get SSL certificates through certbot and letsencrypt. Adding domains with certbot is pretty easy, but changing the domains with certificates is not so easy. In fact, it’s pretty complicated and there aren’t great directions out there (which is why I put this guide together).

In this guide, I’ll show you how to remove a domain from a virtual private server (I use along with removing the SSL certificate. I was hosting a domain and website for a friend, but that person decided they no longer needed the domain. Here’s how I removed it.

First, it’s always a good idea to back up the files associated with the domain, just in case. I use phpMyAdmin to manage my SQL databases. Log in to your phpMyAdmin site, find the database associated with your site, and select Export.

You shouldn’t need to change any options, just select “Go” and phpMyAdmin will export the entire database.

To download all the files associated with your site, you can zip them from an SSH terminal or download them via FTP. I use Filezilla. Find the folder that contains all the files for your website and download the whole thing.

Now that you have a backup of everything, it’s time to start unmounting.

First, you should dismount your site in apache.

sudo a2dissite [domain]

You also need to dismount the site with encryption, which is the same command, but with the following addition:

sudo a2dissite [domain]-le-ssl.conf

Then reload your apache2 configuration:

service apache2 reload.

If you’ve done everything correctly, when apache reloads, there won’t be any errors.

Next, delete the certificate associated with your domain in certbot. To delete the certificate associated with a specific domain, the command is:

certbot delete –cert-name [enter domain here]

That will delete the certificate associated with that domain.

You may also need to update your certificate profile by using the command:

certbot –apache

This will list all of the domains you have certificates for. You can then select all of the other domains on your server but drop the one you want to delete. That will create a new certificate with all of the domains minus the one you have deleted.

If you are wondering whether certbot has actually removed your domain, you can check by going to /etc/letsencrypt. You want to make sure that your domain is no longer showing up in either the /live,  /renewal, or /archive folders. If you still see it in there, it should be safe at this point to delete any folders with the name of the domain in it.

Next, you can delete the corresponding database. In phpMyAdmin, click on “Server: localhost” then click on “Databases.” Select the box next to the database you want to delete, then, at the bottom, click “Drop”. You’ll get a warning about destroying a database. Select OK and the database is gone.

We’re almost done. Now, delete the files for your site. You can do this with the rm command from the terminal or using your FTP client.

Now, you should delete the apache site files that are located in /etc/apache2/sites-available. These are the two that were dismounted earlier: [DOMAIN].conf and [DOMAIN]-le-ssl.conf.

You can restart the apache service one more time to make sure everything is working, but you should be good.

Finally, you can delete the domain from your DNS manager.

That should do it. The domain should now be gone, entirely, from your server.

 1,032 total views,  2 views today

Ubuntu Linux (KDE): “Chrome didn’t shut down correctly” error

Every so often, Chrome on my Linux based computers (one running Kubuntu and one running Linux Mint KDE) starts having a problem.  I like having Chrome save my tabs from my previous sessions so I can pick back up where I left off.  But for some reason, and I’m not exactly sure what that reason is, Google’s Chrome eventually starts giving me the following error message:

Chrome didn't shut down correctly error
Chrome didn’t shut down correctly error

The error says, “Chrome didn’t shut down correctly” followed by a button that says “Restore.”  By clicking on the Restore button, I’m able to get my tabs back, but it’s kind of annoying that I have to do that.  Also, there is no indication of what the problem is in the Chrome crash log (chrome://crashes), which means I really have no idea what causes this problem.  I tried a bunch of suggestions from various websites to get this error to go away and finally found one that works.  Here’s what you need to do.

First, click on Chrome’s Settings option:

Chrome settings menu
Chrome settings menu

In the tab that opens up, scroll to the bottom and select “Show advanced settings…”

Chrome advanced settings
Chrome advanced settings

Near the bottom of the advanced settings is the option you want: System.  There should be two buttons there.  The first one says, “Continue running background apps when Google Chrome is closed.”  I only get the “Chrome didn’t shut down correctly” error when that button is selected.

Continue running background apps when Google Chrome is closed
Continue running background apps when Google Chrome is closed

Uncheck the box next to that option, like this:

Continue running background apps when Google Chrome is closed
Continue running background apps when Google Chrome is closed

Now try restarting Google Chrome.  If whatever is causing this is the same problem for you as it is for me, it should have solved the problem.  If not, sorry.  Keep googling for an answer.   🙁

 1,145 total views

Linux: Creating Maps on Linux with QGIS

For my job, I occasionally need to create maps to illustrate some concept or another.  For instance, it can be useful to see a the racial makeup of the US as a map color-coded to reflect the percent of the population that identifies as black in each state.  It provides a quick illustration of how people identifying as a certain race are distributed across the US.  Back when I used Windows, I had a hard time finding simple software that would create maps like this, but it seemed like there were more or at least cheaper options with Windows.  However, you can’t beat free, and that’s how much the software you’ll need for this tutorial costs!  I’m going to do this tutorial in three parts: 1) Getting ready; (2) Creating your map; (3) Preparing your map for printing/export.

Part 1: Getting Ready to Create a Map

  1. To begin with, you’ll need some software.  The software I’ll be using is called QGIS.  It’s free and is included in most Linux repositories (it’s included in the Ubuntu repositories; I run Kubuntu).  That makes it easy to install, either from Synaptic or from the terminal (e.g., sudo apt-get install qgis python-qgis).  QGIS runs on Windows and Mac as well, so this tutorial will probably work for those OSes, too.  So, step 1 is to install QGIS.
  2. You’re also going to need some shape or map files.  You can create your own, but you don’t want to do that as it takes forever and almost any common map you could want has already been created for you.  There are two great places to download maps: For maps related to the US, try the U.S. Census Bureau’s Tiger files website.  The shape file I’ll be using for this tutorial came from their website.  For a broader array of maps, try NaturalEarthData, which has lots and lots of maps to choose from.  Download the shapefile’s you think you’ll want, unzip them, and store them in a location where you can access them readily.
  3. Finally, if you’re adding data to your map, you’ll need that data, ideally in a spreadsheet.  There are lots of sources of data.  I tend to use a lot from Statistical Abstracts, which is now run by Proquest since it was defunded by the Census Bureau.  But you can use data from wherever.  The key, however, is to make sure it’s cleanly entered into a spreadsheet.

Part 2: Creating Your Map

  1. Once you have your software installed, you’ve download the necessary shape files, and you’ve got your data ready, it’s time to create your map.  First, open QGIS.  You’ll see a blank screen with lots of buttons and such. Lots to do here, but we’re going to keep this simple.QGIS-01
  2. The first thing you need to do is add your shapefile.  Assuming you have downloaded the shapefile and unzipped it, let’s import it into QGIS.  You’re going to add it as a layer.  Click on the add vector layer button:
  3. You’ll then need to find the map file you want to import using the “browse” button and click “open.”QGIS-03
  4. You should then see the map show up in QGIS.
  5. You’ll next need to make sure that you’ve properly prepared your data for importing into QGIS.  There are two things you need to check.  First, right-click on the map or shapefile you just imported and scroll down to “Open Attribute Table.”QGIS-04
  6. You’ll now seen a table with lots of information.  This table basically provides all the information to QGIS to tell it how to generate the map.  You’re going to link your data to this table.QGIS-17
  7. What you need to find is a variable in the table (one of the columns) with information that you can use to link your data file with this table.  You should probably use something like “GEOID” or “NAME”.
  8. By clicking on the header of any of the columns, the table will be sorted by that column.  Since I’m using states for my map, I clicked on the column header “NAME” so the states are sorted alphabetically.  I then checked the names of the states and the GEOID with those in my data file in a separate spreadsheet.  (Here’s a file with accurate names and GEOIDs.)  You’re checking these because this is how you’ll link your data to this table.  Make sure that you have the correct names or GEOIDs in your data file.  Whichever variable/column you choose to link the shapefile and your data file, it’s a good idea to use the same column header in your data file as exists in the shapefile attributes table.  As you can see, I’m using GEOIDs.  (Hint: Most GEOIDs in attribute files have zeros in front of small numbers, like “001” instead of “1”.  To link files, you should set your GEOID column in your spreadsheet software to “text” rather than “numbers” or those zeros will disapper and QGIS won’t link those records.)  Here’s how my data file looks in LibreOffice:QGIS-06
  9. Now, if you’re using LibreOffice, save your data file as a “.dbf” file.  That’s the file format that QGIS reads.
  10. Now you’re going to import your data file into QGIS.  Go back to QGIS and click on the same button you used to add a vector layer.  You’ll have to tell QGIS that you want to see “All Files” as it won’t show DBF files by default, but it can import them.QGIS-07
  11. Find your DBF file and select “Open.”  You’ll now see it in the list of layers.QGIS-08
  12. Now for the important part.   You’re going to link or join your data file with the the shapefile attribute table.  To do this, double-click on the shapefile in the layers box in QGIS and you’ll get a new window:QGIS-09
  13. Click on the “Joins” tab and you’ll see this:QGIS-10
  14. Now click on the green + icon and you’ll see this window:QGIS-11
  15. In the “Join layer” field, choose your data file you imported.  In the “Join field” field, choose the column header for the variable you are using in your data file to link to the attribute file.  In my case, it is GEOID.  In the “Target field,” choose the column header your linking your data file to in the attribute table.  In my case, it is GEOID.  Like this:QGIS-12
  16. Now hit OK on that window and then “OK” again on the properties window and your data file should be linked to the Attribute Table of the shapefile.  You can check that the join worked by right-clicking on your shapefile and opening up Attribute Table again.  You should see your data added to the end of the Attribute Table file.  (NOTE: QGIS is smart enough to know when there isn’t data for a row in the joined data and inserts NULL instead.  For instance, I didn’t import any data for Puerto Rico, so that is listed as NULL.  Also, if for some reason your data don’t get linked, it will insert NULL.  That’s usually a sign that you didn’t enter a value in correctly on your linking variable.)QGIS-13
  17. If your data are in the Attribute Table, you’ve succeeded with the hardest part of this project.  Now we just need to display that data on the map.  QGIS makes displaying data based on colors very easy.  Just below the shapefile you should see a box (it’s called a “group”).  That box is basically just a stand in for the current map that is being displayed.
  18. Double-click on that box and you’ll get a new “Layer Properties” window.  In that window, click on “Style.”QGIS-15
  19. If you want QGIS to do most of the work of coloring for you, look for the dropdown menu that says “Single Symbol.”  That is the current color of the map.  Click on that and choose, instead, “Graduated.”  The options in the window will now change.  “Graduated” means that the color coding will be based on the values of the variable you choose.  You can choose how many colors to display where it says “Classes.”  You can change the colors used where it says “Color ramp”.  You can choose the width of the intervals where it says “Mode.”  But, most importantly, we want to choose the variable that is going to be used for calculating the colors where it says “Column.”  Like I have below:
    (insert screen capture here)QGIS-18
  20. Once you’re ready, click “OK” and watch your map change to reflect color coded values based on your variable, like this:QGIS-16
  21. At this point, you’ve successfully created your map.  In Part 3 below I’ll show you how to prepare your map for exporting to an image file or for printing.

Part 3: Preparing Your Map for Printing/Exporting

  1.  It may seem like you’re done at this point, and you’re pretty close, as you’ve done the hard part.  But QGIS has an additional feature that makes creating maps even nicer – composing the finished map.  Yes, you could just take a screen capture of the map you created and that may be sufficient, but wouldn’t it be nice to have a legend?  And a title?  And, in my case, include Hawaii and Alaska all in the same image?  You can do all of that from the “Print Composer” feature of QGIS.  To open the Print Composer, click here:QGIS-19
  2. Once you click on the “Print Composer” button you’ll be asked to give your print a title.  Title it whatever you want, then you’ll see this screen:QGIS-20
  3. The first thing you’ll want to do is set your Composition size.  If you’re going to save your map as an SVG file, size won’t really matter.  But if you’re saving it as any other image file, you should probably go as big as possible.  This is done using the “Composition” tab on the right side of the screen.QGIS-21
  4. Next, you’re going to want to import the map you just created as the center piece of your print.  To do this, click on the “Add new Map” button:QGIS-22
  5. When you click on that button, you’ll then be able to draw a rectangle on your canvas (the white area) that will import onto the canvas whatever is showing in the main QGIS window.  So, make sure that whatever you want to import onto your canvas is showing in the other window, then drag your rectangle to import it.QGIS-23
  6. You’ll then want to switch to the primary selection tool, which is what you’ll use to interact with the different components of your map composition:
  7. By selecting one of the components of your map, you can also modify it’s properties on the right hand side under “Item Properties”:QGIS-25
  8. We now have the main part of our map.  But, in my case, I also want to include Alaska and Hawaii, as well as a legend.  To add Alaska and Hawaii, recenter the primary QGIS window over them one at a time and then import them the same way you imported the continental US.
  9. The next item I want to add is a legend.  To add a legend, click the icon at the top of the screen to do so:
  10. You can adjust the properties of the legend under the “Item Properties” tab on the right of the canvas.
  11. The final item you should add is a title.  This is done with the “Add new Label” button at the top of the screen:QGIS-29
  12. Like the other items, you can adjust your title under the “Item Properties” tab until you’re happy with it.
  13. Once you’ve got your map how you want it, it’s time to export it.  If you aren’t familiar with SVG files, they are really neat.  Basically, they can scale to any size without pixelating because of how they are stored (SVG stands for “scalable vector graphics”).  That’s probably the ideal format for exporting.  But you can also export the map in a variety of other formats.  Below is the final map exported as a PNG file.



I drew on the following tutorials to create this one.


 762 total views,  1 views today

Linuxmint or Ubuntu: Crashplan backup using headless Synology NAS

If you’re using a Synology NAS box and would like to back up your files to offsite storage service Crashplan (which is relatively inexpensive), there is a relatively easy way to do this.  However, you need to think about the Crashplan software as having two components.  There is the backup engine, or the software that communicates with Crashplan’s servers and sends the files you want backed up to their servers.  Then there is the “head” or user interface which tells the engine what to back up and when.  If you’re backing up your Synology box, then the engine will go on there.  You can use any OS for the head, but I’m running Linuxmint and here is how I got it to work.

1) On your Synology box, first you need to download and install Java SE for embedded packages following these instructions.  Then you need to download and install the Crashplan package for Synology NAS following these instructions. Make sure you choose the correct version of Crashplan from the link above.  You don’t want to install CrashPlan Pro if you’re just running CrashPlan – it won’t work.

2) Once you’ve got both of those up and running on your Synology box, you should see something like this:




3) The next step is to install CrashPlan on your desktop computer so you can control the engine on your Synology box (i.e., tell it what to backup and when).  First, download the CrashPlan software for your OS here.  Once you’ve downloaded the .tgz file, uncompress it to a folder (doesn’t really matter where; your’e desktop or home folder will work).  Then open a terminal and navigate to where you unpacked the CrashPlan files.  At the terminal, type:

sudo bash

You’ll then need to follow the prompts, but it should install the software on your computer.

4) Now is the tricky part.  If you follow the directions on CrashPlan’s website to connect the “head” to the “headless engine” it won’t work.  Their directions say to edit the file /usr/local/crashplan/conf/ by uncommenting the line #servicePort=4243 and changing it to servicePort=4200.  You then need to set up an SSH tunnel.  Here are their directions.  I tried a lot of variations of this and didn’t work.  But you know what did?  Editing a different line.  In that same file, uncomment the line that says #serviceHost= and change it to serviceHost= (i.e., the IP of your Synology box).  Save the file and close it.

5) You should now be able to open the CrashPlan GUI and control your Synology box remotely.

 577 total views,  2 views today

LinuxMint or Ubuntu: How to Automount Synology Shares

UPDATE:  As of Ubuntu 13.04, these directions no longer work.  I figured out a way to get this to work, however.  See the updated directions at the bottom of this post.

——————Old Directions————————————

If you’d like to share your network attached storage from a Synology file server with your Linuxmint or Ubuntu machine and have it appear as just another folder, you can set the Synology unit to automount on your computer.  These steps assume that you have already set up your Synology unit and are sharing at least one folder over the network.  It also assumes that you are already connected to the same local network as your Synology unit.

To set up the automount, do the following:

1) Install the package nfs-common, either using synaptic or the command line:


(from the command line: sudo apt-get install nfs-common)

2) Open a console or terminal and type “ifconfig” to find out your IP address on your local network.



Let’s assume your IP on the local network is (as shown in the figure).

3) Open the Synology interface and then open the Control Panel:


4) Click on “Shared Folder” which will show you a list of your shared folders.  Synology comes with the ability to share folders using the nfs protocol.  It is a secure protocol that requires you to add the IP address of the computer that is going to be allowed to access files on the Synology NAS.  Once you see the shared folders, select the folder you want to share, then click on “Privileges” and then “NFS Privileges”.



5) In the next window, click on “Create” and then add the IP address of the computer with which you want to share that folder.  You should also decide what privileges you want to grant that computer.  If you grant it read/write privileges, that computer can modify files.  If you grant it the read privilege, that computer can only read files.


6) Once you’ve done that, you should be able to access the shared folder over your network.  However, what we want to do is make any shared folders automatically mount over the network every time you start your computer.  To do so, you’ll need to do two more things.  First, create a folder on your computer to map the shared folder to.  An ideal location is in your home folder since you already have read/write privileges there.  So, for instance, if you are sharing photos over the network, create a folder in your home directory called “NASphotos” by doing the following from the terminal (or just create it in a file explorer): mkdir /home/user/NASphotos

7)  Next, you’ll need to edit your /etc/fstab file.  To do so, open a terminal and type: sudo kate /etc/fstab

(You could also use gedit or some other text program, like nano.)

8) This should open the /etc/fstab file in a text editing program.  You’ll need to add the following lines to your /etc/fstab file:

Any line that starts with the pound sign “#” is a comment line.  I like to add a comment line so I know what my command is doing.  Here’s the line I add:

# automount file synology

Next is the line that actually does the work: /home/user/NASphotos nfs nouser,rsize=8192,wsize=8192,atime,auto,rw,dev,exec,suid 0 0

You’ll need to change the parts that are bolded.  The IP is the IP of your Synology unit on the network.  If you have a different name for your volume on your Synology unit, you’ll need to change “volume1” to whatever it is.  Replace “photos” with the name of the shared folder on your Synology unit.  Replace “user” with your username.  And replace “NASphotos” with whatever folder you created in step 6.

Save the file and close it.

8)  Now, assuming you’ve done everything correctly, type the following into a terminal to mount the shared folder: sudo mount -a

Your shared folder should now show up in your file explorer (e.g. Dolphin) and should do so every time you start your computer.  Depending on the privileges you granted yourself on the Synology NAS, you should be able to read and/or write whatever files you’ve stored on the Synology unit as if they were on your own computer.


——————————————New Directions—————————————

UPDATE: As of Ubuntu 13.04, the directions I gave above stopped working. After tinkering with the settings for a while, I found a way to make it work.  Follow all of the above steps.  However, when you edit the fstab file, try using the following format for each share you want to mount: /home/user/NASphotos nfs rw,hard,intr,nolock 0 0

This is working for now.  This was based on this article on the ubuntu help site.

 4,909 total views,  8 views today

ubuntu: HP Elitebook 8540p wireless

This is primarily a note for me, but I just spent 3 hours reformatting my HP Elitebook 8540p because I couldn’t get it to connect to my new 802.11n router.  Turns out all I needed to do was switching the security on the router to WPA from WEP.  So, anyone searching for how to get their Intel Centrino Advanced-N 6200 wireless card running Linux to connect to their 802.11n router, make sure you’re using WPA or it won’t work.

 276 total views

LinuxMint or Ubuntu: Automount Server Share

(Updated to reflect changes in Ubuntu 12.04 LTS – 5/15/2012)

While I’m still not 100% sure how I got my file server to share all the files across the network (whatever I did, it worked; when the server dies, I’ll figure it out and post it here).  Regardless, I recently reformatted my desktop and had to set up the file server share to automount on my desktop for easy access to the files (I store all my music, videos, and lots of other files on the file server).  Here are the steps I took to set up my automounting file share on my Linux desktop (courtesy of the ubuntu wiki and this website as well).

1) First you need to install two packages: “samba” and “smbfs.” You can install these from the terminal or using synaptic.  Here’s how you would do it from the terminal:

sudo apt-get install samba smbfs

2) Once those are installed, you need to create a mount point for your share.  The easiest way to do this is from the terminal as it requires root privileges.  The share, which, in my case, is called “fileshare” is mounted in my user directory, so you use the following:

sudo mkdir /home/(your username)/fileserver

3) Next you need to edit the fstab file.  This is a file that tells the operating system which drives should be mounted on startup.  To edit it, enter the following at the terminal:

sudo gedit /etc/fstab

4) The text editor will pop up with your fstab file open for editing.  You need to add a line to the fstab file that tells the operating system what to mount on startup, where to mount it, and what permissions to use.  Here is the line I used

//  /home/ryan/fileserver  smbfs  username=XXXXX,password=XXXXXXX 0 0

What this tells the operating system is that I want to mount a network share “//” into the folder “/home/ryan/fileserver”.  I do this with the software package “smbfs.”  You’ll need your username and password for the target machine.  Save the fstab file and close it.

5) The last step is to go ahead and mount the share.  This is also done from the terminal using the following command:

sudo mount -a

This tells the operating system to remount everything in your fstab file.  Your file share should now show up as a drive on your desktop and you should be able to read and write to it directly as if it were a drive on your computer.

 234 total views,  2 views today

LinuxMint: Keyboard Shortcuts to Move Windows Between Monitors

If you don’t have multiple monitors hooked up to your desktop computer, you’re really missing out.  Having dual monitors is a delight when it comes to being able to see more than one window and work even faster.  And to make the experience even more enjoyable, Ubuntu variants of Linux, including LinuxMint, my new Linux distribution of choice, come pre-installed with CompizConfig Settings Manager, which has a nice windows management utility built in that allows you to use keyboard shortcuts to move windows between monitors.  So, for instance, let’s say you’ve got your browser up on the left monitor, but you want to move it to the right monitor so you can have it open at the same time as you work on a spreadsheet.  You could shrink the browser window then drag it to the other monitor.  But that would require several several clicks and dragging your mouse.  Wouldn’t it be nice if you could simply hit a keyboard combination that moved your entire window from one monitor to the other, while still maximized?  The “Put” utility in CompizConfig allows you to do this.  Here’s how:

1) Open CompizConfig Settings Manager (it’s pre-installed in LinuxMint).  If you’re running Ubuntu, you may have to install it using the software center or synaptic:

opening CompizConfig Settings Manager in LinuxMint (click to enlarge)

2) With the settings manager open, scroll down to the section labeled “Window Management.”  You should see “Put” as an option.  Select the box next to it, then click on “Put” to enter the settings:

find “Put” in the CompizConfig Settings Manager window (click to enlarge)

3) Inside the “Put” submenu you’ll see several options.  The one you want to move windows between monitors is “Put within viewport,” which is the fourth from the top.  Select the + sign next to it to see the options.  While you can “Put” your windows in lots of locations, I primarily just use two: “Put Left” and “Put Right”.

the “Put” settings submenu (click to enlarge)

(In the above image I had already set up my key combinations.)

4) To set up a key combination to use the “Put” utility, simply click on the button labeled “Disabled” across from the relevant command that shows a small keyboard (you can create key combinations using mice as well, which are just below the keyboards).  That brings up this option:

click “enabled” to tell CompizConfig to use the keyboard combinations

5) Select “enabled” and you’ll see this:

set your keyboard combination here

6) Click on “Grab key combination” and another window will pop up that will detect the keyboard combination shortcut you want to use to put your windows across monitors.  I use “Alt+Super+left” for moving windows to my left monitor and “Alt+Super+right” to move windows to my right monitor (as shown in the image above).  Once you enter your keyboard combination, hit “OK” in the prompt, set up any others you want to use, and then click on “Back”.  Make sure you’ve selected the checkbox next to “Put” then close CompizConfig Settings Manager.

7) You can now try out your keyboard combination by selecting a window and using your combination to move it across monitors.  FYI, if your window is maximized, you’ll have to hit the combination twice.  When you hit it the first time, the window will move just a little bit to indicate to you that the software knows you’re trying to move the window but that the window is maximized.  Hit it again quickly and the window will jump to your other monitor and maximize itself on that monitor as well, beautifully taking into account panels and monitor size.  I show the actions in the video below:

Note: Another very useful keyboard combination utility that comes built in with CompizConfig Settings Manager is the “Grid” utility which allows you to move a window to different areas of your monitors as well.  This utility is located in the same area as the “Put” utility.  It is activated by default.  The keyboard combinations are “Ctrl+Alt+keypad numbers”.  So, for instance, to move a window to the center of a monitor, hit “Ctrl+Alt+KP5,” which is the center key in your keypad.  To move it to the right, use KP6, etc.  Grid has several levels of alignment built in, which you can see by hitting the combination repeatedly until you get the window to the size you want, as shown in the video below.

 871 total views,  1 views today

Utah Trip – December 29th

We were supposed to go up to Ogden to meet with some of my childhood friends, but a massive afternoon snow storm that dumped about 10 inches of snow on West Jordan postponed that trip.  Instead I spent the day working on Rosemary’s computer and otherwise not getting much done.

As far as Rosemary’s computer goes, she is the perfect candidate for running Linux.  She uses a browser and occasionally Word and Excel.  Linux has all of that covered. She also does genealogy, which can easily be done in Gramps.  So, Rosemary is now running Ubuntu 10.10.

 93 total views