Thursday, 15 November 2007

Howto Setup SMB Server using NTFS partitions on Ubuntu

In GNOME, there is no configure tools like "kdenetwork-filesharing" in KDE, which will automatically add an option 'msdfs proxy = no', this made your folders can not be accessed properly within your workgroup. Maybe this is a bug or a carelessness, but just like KDE, too many bugs, it's ok, I am used to it. Each time I install Linux distro with KDE, I must install some Gnome programs to make the programs installation job done without keep facing KDE's crash.
Actually in Gnome such a tool is not necessary, Gnome is simple and seamlessly works together with (almost) all the service. SYSTEM-ADMINISTRATION-SHARED FOLDERS is the right place to configure you samba server simply. Although too few stuff there, but these are the essential part. If you prefer expert mode, why not use vi to modify /etc/samba/smb.conf, gui tools is just for beginners and lazy peoples like me.

Why I select Ubuntu. At beginning, I tried Opensuse, the default setting doesn't show Chinese characters properly, and the essential problem is that the default setting for mount NTFS partitions is not writeable. So I gave it up. Forgiving me don't want to spend time on to learn how to change fonts and mount options. I prefer more human being friendly default setting, like Ubuntu.

  1. To share files (here what I want to shared is the folders from NTFS partitions)
    For security reason, I prefer add some password for my server, the samba default setting doesn't allow guest access as well.
    In this case, you should use 'sudo smbpasswd -a user' to add user and password. Here the user added must exist in the server system users database, otherwise, error message of "Failed to modify password entry for user" will come out.

    • Folders from NTFS partitions are shared

      1. the partition is automatically mounted from /etc/fstabs
      Although when you shared folders from nautilus, there are some error messages telling you access denied stuff, but it doesn't matter, the Windows will access it properly. But Linux client can not do this.
      Because the access permission is just for the root, while not you. Linux box do the permission check more than the Windows boxes.
      2. the partition is mounted by you after boot from MY COMPUTER
      In this case, there will not any error messages when you share the folders from Nautilus. And Windows, Linux clients can access it very well. Because this time the access permission is for the current user,you. But this is not suitable for files-sharing server.

      The solution is 1). For Windows clients it works well. For Linux clients this job can be done by 'mount -t smbfs -o username=yourusername,password=youruserpassword //server/dir /mnt/folder'. Here smbfs is need to be installed.

    • Whole NTFS partition is shared
      Just share it. It works well for Windows and Linux clients. But the flexibility is limited, you can not specify folders to share.

  2. Printer Server

    In Gnome, the samba configure tool is still not necessary. Normally the printers in the SYSTEM-ADMINISTRATION-PRINTING will be added to smb server, except bugs exist.
    my HP LaserJet 2200 with usb cable can be founded by Ubuntu automatically and works locally. But from the client machines, the printer is invisible. While the HP Deskjet 1220C can work well both local and client machines.
    The reason is the Gnome auto founded driver is not so correct, although it's ok for local. Here I use 'kcontrol' to add the printer, in kcontrol this is one driver select option "usb port", with this option everything works well.

    Maybe this is a bug for Gnome system-config-printer, where is no option for the usb port, just list some printers the ubuntu founded, and some specific port. Just no usb port, but just the auto founded usb printer is not correct.

1 comment:

Cross Z said...

From Ubuntu Hardy, Gnome printing works fine, no need help from KDE to install the 'correct' printer, while the KDE found printer doesn't work any more.

One thing need to know if the printer server is set to be authorized from the clients, the client must verify the printer firstly then configure driver, Otherwise clients can not print. This is the case for Linux.

On windows, just goto that server from File Explorer, add that printer. All done without authorizing things. In this case, Linux is more secure, but for Windows it's more compromise.

My photo
London, United Kingdom

Facebook & Twitter