Friday, December 28, 2012

Installing Samba and sharing files within a home or office network

There are innumerable tutorials to explain sharing a folder, a partition or a disk drive using samba. Here's one more, it doesn't hurt, on the contrary it may help someone.

The best way to use old laptops and desktops is by installing a Linux distro and experimenting with it as a file server. After you install the OS and later ssh, samba, remote desktop, apache etc., you can add it to the network and do all the rest with another computer through remote desktop or ssh.

I used Linux Mint 14, Nadia, which is superb, in terms of quality, functionality, ease and aesthetics. In my scenario, I have mounted the storage partition as /D in my Linux Mint box. For this tutorial, we are going to use an ordinary user named "john" who's password will be needed to login to the samba network.

I am going to tell you how to install samba and share your folder step by step:

1) Install samba

sudo apt-get install samba

2) Stop samba in case it is running

sudo /etc/init.d/samba stop

3) Backup your default samba config file smb.conf (this step is optional)

sudo mv /etc/samba/smb.conf /etc/samba/smb.conf.backup

4) Under home or any location create a new smb.conf using, vi, nano, emacs, gedit, or kate

the contents looks like this:

path = /D
available = yes
valid users = john
read only = no
browsable = yes
public = yes
writable = yes


i) What does [test] mean ? Your shared folder will be called test in the network, but you can use any name as you like

ii) What is /D? It is the path is the path to the folder you want to share e.g if you want to share a newdirectory in home, it would be /home/john/newdirectory
In my case, I mounted the NTFS D partition (of windows) as /D so I used it.

iii) Who is john? john is a user whose credentials will be needed to login to the shared folder. john can be replaced by any name you want to use.

Save the smb.conf file.

5) Copy your created smb.conf to its right workplace

sudo cp smb.conf /etc/samba

6) Change permissions of the shared folder in case it does not have read-write permission to all users
sudo chmod 0777 /D

7) Add a user with access rights to the samba share

Create user john without a home (i.e., /home/john) using /bin/true feature

sudo useradd -s /bin/true john

Create password for john (optional), if you don't want to use john as normal user login, you can skip this step

sudo passwd john

8) Make sure you add john to group plugdev

sudo usermod -a -G plugdev john

9) Create a samba password same as above (same as login password) to avoid confusion

sudo smbpasswd -a john

9) Test the parameters

sudo testparm

10) Restart samba

sudo restart smbd

VoilĂ  samba

Check your folder in your Linux (under network) or windows network (under Workgroup). Enter username john and password, now your old computer is a silent new file server.

To stop sharing and removing samba:

1) Stop samba

sudo stop smbd

2) Delete user

sudo userdel -r john


sudo apt-get remove samba --purge

PS: I personally feel running a computer as a server continuously for trivial functions is a huge waste of power. So shut down your "server" whenever you won't use it for extended periods of time. Everytime you start the computer, samba will come alive and serve your folders and files.

Tuesday, March 27, 2012

Ubuntu Precise Pangolin - Another KDE user tastes Unity

The new Ubuntu LTS release looming in the horizon tempted me to try it out as a candidate for a my next Linux OS. Here's what I think.

Ubuntu 12.04 LTS is pretty stable for its current status as beta. The linux kernel at version 3.2.0-20 feels good and seems to support wider range of hardware. The AMD Turion CPU seemed to be reasonably cool while idle. But still Linux has a long way to go in terms of prolonging battery usage. All applications are up to date at least to the latest stable versions which is the best thing in Ubuntu.

Now jumping into the hot topic of opining about Unity, I have mixed feelings. I have migrated from my favourite KDE and experimenting with Unity here. To me Gnome is as strange as is Unity. So I am unlike any long term Gnome follower. Unity is stable enough at this stage than in Ubuntu 10.10 where it froze and was unusable in my laptop configuration. The best thing I liked is the use of the Windows button which triggers the HUD (Heads up display / launcher) and you can open up any program without the hassle of clicking various menus. This way of launching programs is a definite plus for CLI savvy users but might not impress everyone. Unity has simplified the use of menus significantly and in one way claimed more desktop space (I have set the left menu bar to autohide). Moreover there is only only top panel instead of two in Gnome 2.

Now coming to the things I don't like about Unity. I can't figure out why have they designed the launch bar to be on the left side of the screen. Leave aside usability, I have to say its huge and its ugly. I am not closed to change, but change should be beautiful. The dock at the bottom in MacOS X simply feels much more aesthetic.

The second major issue is again in the dock (left bar). All minimized windows go back to the left bar along with the launch icons. Its a new thing and all users must to get used to it. Instead of clicking the minimized programs in the bottom task bar, users have to seek their minimized programs stacked in the left dock. This is the major hurdle that many users face and its the same which makes people hate Unity. We are so used to MS "Windows" style operation that this is a big hurdle in usability. Again the buttons on the left is a hurdle from my point of view.

Every new gadget will have a new interface and people have to learn to use it. But computers to most of us is not a new gadget. If Ubuntu is targeting virgin computer users with Unity, then it might be a different thing, but not the general population who are used to computers since the age of Windows 95. Even for new computer adopters the usability of Unity is should be tested and can be improved.

I would say Unity is a bold move on Canonical's part but they have to be very careful to lure users not shun them away. As I see, they are not quite there in luring users. As many bloggers and columnists have pointed out, its hard for me to see where Ubuntu will be in another five years. They are betting everything in innovation which particularly is not so attractive as MacOS would have made.

But still Precise Pangolin will be a wonderful release and will form a great basis for the thousands Ubuntu based remixes to follow. So the greatness of Canonical's job is that despite Unity, their efforts will still play a major role in the Linux world.

My message to Canonical is, I like your ideas about innovation, but can you figure out a way to create a better dock.