Thursday, August 29, 2013

How to setup an sftp user to have limited access in Ubuntu Server

Below you'll find how to setup a user to have limited access (chroot) to your Ubuntu Server.  I wanted to setup an account for my friend but didn't want him to have the ability to browse my server.  After browsing the web I consolidated these steps a successful and stress free setup (I hope):

Create a new user (if necessary):

sudo adduser --system -no-create-home USERNAME

This creates a new user w/o a home folder.  I did this because I already had a folder I wanted to give as the primary access point.  If you wish you can just use:

sudo adduser USERNAME

if you want to make the user's home folder the point of access.

Make the folder if it is not already created:

sudo mkdir /shared/folder

Change ownership of the folder:

sudo chown root:root /shared/folder
sudo chmod 755 /shared/folder

I've found that if you do not set it to root you won't be able to successfully connect via sftp.

Edit the sshd_config file using nano or your preferred text editor:

sudo nano /etc/ssh/sshd_config

Comment out the line and add the line below:

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

Add this section at the end of the text file then save:

Match User USERNAME
  ChrootDirectory /shared/directory
  ForceCommand internal-sftp
  AllowTCPForwarding no
  X11Forwarding no

Restart the ssh service:

sudo service ssh restart

Now, try using an FTP app, such as Transmit and connect using the new user.

Hope this helped.

*I only needed to add a user.  It might be better to create an sftp-group and then use "Match Group sftp-group" if you plan on having multiple users.  Then in the future you can just add the newly create user to the group without having to edit the sshd_config file.  %h points to the users home folder

Match Group GROUPNAME
  ChrootDirectory %h
  ForceCommand internal-sftp
  AllowTCPForwarding no
  X11Forwarding no

Monday, August 19, 2013

Update Plex repository in Ubuntu Server

Receiving this error on Ubuntu Server when you run the update?

Failed to fetch http://www.plexapp.com/repo/dists/lucid/main/binary-amd64/Packages 404 Not Found
Fix it below:

Edit the sources.list file:

sudo nano /etc/apt/sources.list

At the bottom add:

deb http://plex.r.worldssl.net/PlexMediaServer/ubuntu-repo lucid main

Add the repository key:

wget http://plexapp.com/plex_pub_key.pub
sudo apt-key add plex_pub_key.pub
rm plex_pub_key.pub

Run the update:

sudo apt-get update

You might receive a duplicate error.  To fix this edit the sources.list.d file.  First list to see the duplicate:

ls /etc/apt/sources.list.d

You should see plex and plexmediaserver.  Delete the plex file.

sudo rm -i /etc/apt/sources.list.d/plex.list

I didn't remove the plex.list.save file but it probably isn't necessary anymore.  You can also go back to the sources.list file and comment out the deb line you added above.  I believe it is only necessary if you are going to install Plex.

Hope this helped.

Sunday, August 18, 2013

Install Transmission on your Ubuntu Server

Here's how you do it:

From the command line type:

sudo apt-get install python-software-properties

Next:

sudo add-apt-repository ppa:transmissionbt/ppa

Update the apt-list:

sudo apt-get update

Install Transmission:

sudo apt-get install transmission-cli transmission-common transmission-daemon

Let's make some directories where we will have Transmission use.  If you already have folders set up you can use those or you can change the path and create folders wherever you like.  The commands below create the folders in your user's home directory:

mkdir ~/Downloads
mkdir ~/Downloads/Completed
mkdir ~/Downloads/Incomplete
mkdir ~/Downloads/Watched

As you guessed, Completed will hold all the files that are complete, Incomplete will store the files that are still downloading, and the Watched folder is where you'll drop the torrent files in and have Transmission continuously look in that folder.  When it detects a new torrent file it will automatically add it to your downloads.

Change some permissions (username = your username).  If you changed the directory paths above you'll have to make the same changes to the commands below:

sudo usermod -a -G debian-transmission username
sudo chgrp -R debian-transmission /home/username/Downloads
sudo chmod -R 775 /home/username/Downloads

Time to edit some config files.  Stop Transmission:

sudo /etc/init.d/transmission-daemon stop

Open the config file:

sudo nano /etc/transmission-daemon/settings.json

Make these changes (again, make sure to change the username and directory path (if necessary):

"download-dir": "/home/username/Downloads/Complete",
"incomplete-dir": "/home/username/Downloads/Incomplete",
"incomplete-dir-enabled": true,
“rpc-authentication-required”: false,
“rpc-whitelist-enabled”: false,


Add these lines at the end of the file before the closing curly bracket:

“watch-dir”: “/home/username/Downloads/Torrents”,
“watch-dir-enabled”: true


Now start Transmission:

sudo /etc/init.d/transmission-daemon start

The default port for Transmission is 9091 so on your browser you can navigate to yournasip:9091.  Enjoy!!

Sunday, August 11, 2013

Apple's Free App of the Week: Rise Alarm Clock

Change things up with this free app of the week on Apple called Rise Alarm Clock.  A simple and intuitive interface with the ability to set custom sounds for your alarm clock.  What can I say, it's free, give it a shot.

[iTunes Link]


Monday, August 5, 2013

Assassin's Creed PC Xbox 360 Controller Fix


So I recently purchased and started playing Assassin's Creed (probably works with the rest of the franchise), I know I'm quite late to the party, but I purchased it during the Summer Steam Sale.  Anyways, I was able to bind most of the buttons but then I had issues with the triggers.  Having to use the buttons right above the triggers was a pain since using the triggers is much more comfortable.  After some browsing I was able to find this fix online.  All you have to do is drop the files in the Assassin's Creed game folder within Steam.  Now all the buttons are mapped, especially the triggers, making the game more enjoyable.  One issue I found is that I am not able to remap the buttons to anything else, pretty much locked :(.  Enjoy!!

*I'm not sure if the rest of the franchise has this issue, but I found the fix for Assassin's Creed II and it works fine for Assassin's Creed I.

Assassin's Creed Xbox 360 Controller Fix

Sunday, August 4, 2013

iOS App of the Week: Bad Piggies


From the makers of Angry Birds might be the only similarity it has to Bad Piggies.  Unlike Angry Birds where you shoot birds and destroy things, your goal in Bad Piggies is to build a machine and make it to a finish line.  All in all it is an enjoyable game.  If your the type that likes to build things than I would give this game a try.  Hey, it's free so why not.

iTunes Link

Friday, August 2, 2013

Alternatives to eBay, Gazelle, and Craigslist for Phones and Tablets


So I recently stumbled across the website Swappa.  It's a selling and buying site for phones and tablets.  But, unlike eBay, there aren't any seller fees.  The fee that is there is paid by the buyer and it's a flat fee of $10.  Compared to Gazelle, you'll most likely get more money for your device and as for Craigslist, you won't have to meet some stranger in a public place.  If you are in the market to buy or sell a phone or tablet, I would recommend checking out Swappa.

Thursday, August 1, 2013

Buy one get one coupon for Golfnow

Currently there is a coupon for a BOGO round at Golfnow.com.  It only works for hot deals, designated with a flame like the one below,



so tee times are limited, but you can expect to save some big bucks.

Coupon: FBBOGO13

Amazon Prime $79 + $10 Amazon.com Gift Card


Amazon is currently having a Prime offer, which are pretty rare, but if you sign up within the first 30 days of your trial you get a $10 Amazon.com Gift Card.  So a year of Amazon Prime for only $69.  I've had Amazon Prime for a few years now and it is fantastic.  I order a lot from Amazon so the free 2 day shipping is a huge plus.  Not only do you get free 2 day shipping but you get access to their unlimited streaming services and the Kindle library.

Link:  www.amazon.com/primeoffer



2 Months of Hulu Plus for Free


Head over to huluplus.com/ps3offer and sign up to get 2 months of Hulu Plus for FREE.  If you've signed up for a trial before you'll need a new account, new email, and new credit card in order to qualify for the free trial.  If you use a credit card you've used before you might get charged immediately.  If so you'll have to contact Hulu Customer Service (888-713-2455) to get a refund.

*Reminder: Remember to turn off auto renewal so your card doesn't get charged.

Guys, don't know which shoe to wear?

If you're like me and not sure what shoes to wear with which outfit then check out this handy chart made by the user jdbee over at Reddit which gives you a few options on which shoes match which outfit.  Hopefully you have a few different styles of shoes already.