The popular Handbrake video conversion application has sometimes had difficulty running on new versions of Ubuntu Linux, but the current version of Handbrake, 0.9.8, works just fine on Ubuntu 12.04 Precise Pangolin. Best of all, the installation only takes a few Terminal commands.
First, you’ll need to add Handbrake’s PPA (personal package archive) to your system. Go to a Terminal window and type this command:
sudo add-apt-repository http://ppa.launchpad.net/stebbins/handbrake-releases/ubuntu
Enter your password to authenticate, and the PPA will be added to your system.
Next, update your system’s listings of its software sources with this command:
sudo apt-get update
After the listings have been updated, install Handbrake itself with this command:
sudo apt-get install handbrake-gtk
After the installation is complete, you can launch Handbrake by going to the Dash, searching for “Handbrake”, and clicking on the program’s icon.
One of the most common uses of a Ubuntu 12.04 Precise Pangolin machine – whether a server or a desktop – is to share files across the network. If you’re not familiar with the term, “file sharing” means to make a folder on your system available to clients on the network. From their own machines, users are able to access your shared folder from their computers, and depending upon how you’ve configured the security, they can copy the files for themselves, alter the files, add new files, or even delete files.
There are a number of different programs that offer file-sharing capabilities. Most Ubuntu 12.04 Precise Pangolin systems use the “Samba” software, since it is can easily share files with Windows-based computers. It’s common to find organizations that have a number of users with Windows systems storing their data on a Linux server running Samba.
In this post we’ll show you how to set up a basic Samba server, and how to access those shares from client computers, on a Ubuntu machine.
Samba has a vast array of options and configuration settings, but here we’ll show you how to set up and configure a basic Samba server with one user.
First, you’ll need to install Samba. Make your way to a command prompt and type this command:
sudo apt-get install samba
Enter your password to authenticate, and apt will download and install Samba and its attendant utilities for you.
It’s important to realize about Samba is that it stores its own set of user accounts, separate from the main accounts, in the /etc/samba/smbpasswd file. That means you’ll need to create a separate Samba password for every user you want to access your file shares. You create this password using the smbpasswd command. For example, to create a command for a user named camalas, here’s how the command should look:
sudo smbpasswd -a camalas
Be sure to give camalas’s Samba account an appropriately strong password (make sure it includes uppercase, lowercase, punctuation, and numbers). Once camalas’s password is created, the next step is to create a directory for her to share. Begin by creating a folder named ‘test’ in camalas’s folder, which we’ll use for our first shared folder:
(NOTE: DO NOT use sudo to create the folder, because then the owning user and group will be set as ‘root’, which means you won’t be able to access the folder using your Samba username and password.)
The next step is to edit the /etc/samba/smb.conf file, the main configuration file for Samba. As always, make a safe backup copy of the original smb.conf file to your home folder, in case you make an error:
sudo cp /etc/samba/smb.conf ~
Now use vi to edit the /etc/samba/smb.conf file:
sudo vi /etc/samba/smb.conf
The smb.conf file is long and rather complex, but for the purposes of this demonstration, you can ignore most of it. Key down to the very end of the file and insert this text:
path = /home/camalas/test
available = yes
valid users = camalas
read only = no
browsable = yes
public = yes
writable = yes
(There should be no spaces between the lines, and note also that there should be a single space both before and after each of the equal signs.)
Here’s what some of the more important configuration options mean.
-The “[test]” gives the name of the file share.
-The “path” option specifies the location of the folder to be shared.
-The “available” option specifies that the file share is available to clients on the network.
-The “valid users” option details the users that are allowed to access the file share. In this case, we’ve set it so that only the camalas account can access it. You can add additional accounts here, if you prefer.
-The “read only” options specifies whether nor not clients will be allowed to write to the file share.
-The “writable” option specifies that data can be written to the file share.
The settings specified above will share the test folder we created earlier, and give your username and your username alone permission to read and write to the folder. Once you have input the changes, save smb.conf, exit vi, and restart Samba with this command:
sudo restart smbd
(This will force Samba to restart, re-reading its configuration files and activating the share you just created.)
Once Samba has restarted, use this command to check your smb.conf for any syntax errors:
If you pass the testparm command, Samba should be working. Try accessing the share from another client on your LAN.
SSH stands for “secure shell”, and it is a network protocol that allows you to securely send commands to a remote machine. The “secure” part comes from the fact that the connection is encrypted, which means that an attacker cannot eavesdrop on the connection, or intercept and replace your commands with his own midway through transit. SSH is pretty reliable and secure, and is commonly used in the Linux world. Administrators often use it to remotely manage machines – it’s usually more comfortable to control a server from your laptop than in the chilly and noisy server room.
In this post, we’ll show you how to set up an SSH server on Ubuntu 12.04 Precise Pangolin.
The default SSH server package for Ubuntu is OpenSSH Server, which we’ll use here.
First, you’ll need to install OpenSSH Server. To do so, open up a Terminal window and type the following command:
sudo apt-get install openssh-server
Enter your password to authenticate, and the apt utility will download and install OpenSSH Server for you. Depending on the speed of your Internet connection and your computer, the installation may take several minutes.
Once the installation has finished, return to the Terminal window. We’ll need to make a few changes to your /etc/ssh/sshd_config file in order to increase SSH’s security. First, as always, we’ll want to make a backup copy of your sshd_config file in case anything goes wrong. Type this command into the Terminal:
sudo cp /etc/ssh/sshd_config ~
This will make a backup copy of the sshd_config file in your home directory.
Next, we’ll need to edit the sshd_config file itself.
sudo vi /etc/ssh/sshd_config
(Note that you can use emacs or gedit or another text editor of your choice.)
Like almost every other server software package, SSH is controlled by a number of directives in its configuration file. The default installation of OpenSSH server is reasonably secure. However, you might want to make a few changes to tighten up its security to additional degree.
The “PermitRootLogin” directive is one you’ll want to change. Once you’re editing the /etc/ssh/sshd_config file, you’ll want to change the following directive as follows:
This will keep anyone from attempting to log into your server via SSH as root. It’s generally a good idea not to allow any to log into your SSH server as root. If an attacker manages to hack into your SSH server with the root login, he will have complete control over your machine, and that is definitely not a good thing.
Another directive you might want to change is the “AllowUsers.” When the AllowUsers directive is active, only users specifically specified in the directive can access the system through SSH. This adds an additional layer of protection to your SSH server by only allowing specific users to connect via SSH. For instance, if you wanted to limit SSH access to just the “camalas” user account, edit the AllowUsers directive like this:
To add multiple users to the AllowUsers directive, just add them one by one without commas or semicolons. An AllowUsers directive that permits the camalas user account and the lmaraeus user account to log in would look like this:
AllowUsers camalas lmaraeus
You may also want to consider changing the Port directive. By default SSH runs over TCP/IP port 22, which means that any malware bot autoscanning port 22 can target it. If you set up your user accounts with a weak password (always a bad idea), eventually an automated bot might break through and guess the password. Changing the Port directive to something different will make SSH run over a different port, blocking some of those automated cracking attempts. To set SSH to run over port 5699 instead, make sure your Port directive looks like this:
Note that if you change your SSH server’s default port, you’ll need to remember the new port number when using an SSH client, which we’ll cover in the next section.
After you’ve finished changing the directives in /etc/ssh/sshd_config, switch vi to command mode, and save and quit vi. After you return to the command line, restart the SSH daemon with this command:
sudo restart ssh
You should now be able to SSH into your Ubuntu machine from another system with an SSH client.