Thursday, April 10, 2014

Enable Samba browsing in Thunar

If you enter location path start with smb:// and get a red stop sign, it means you don't have gvfs-smb install. Simply fire up your terminal and type:
sudo yum install gvfs-smb -y
You might want to install Gigolo too to manage your network folder.
sudo yum install gigolo -y
 Voila! Your address bar should work with smb:// now.

Thursday, January 16, 2014

Problem connecting Xrdp

If the error appeared as "problem connecting" when connecting to remote desktop using xrdp, it is most likely the remote Linux does not have VNC server installed.

(1) To verify this, you can type:
sudo tail /var/log/xrdp-sesman.log

(2) If you see the error message below, then it means you don't have VNC server installed.
[ERROR] another Xserver is already active on display xx 

(3) To fix this, simply run this command:
sudo apt-get install tightvncserver

(4) After that, restart xrdp service by running:
sudo service xrdp restart

Here's why:
xrdp is the daemon that handles RDP remote desktop access from Windows machines to your Linux Mint PC. But it's not enough to install only xrdp - you need a VNC server. Unfortunately it's not automatically installed with the xrdp package.

The error message "error - problem connecting" after a successful login message isn't very helpful either. Searching the Internet can drive you in circles - I wasted at least 2 hours on finding out that I forgot to install the VNC server - ouch.

Thanks powerhouse from Linux Mint forum who shared this useful information.

Thursday, December 5, 2013

Samba Share Permission in a Nutshell

In this post I'm writing all the troubles that I faced when setting up samba shares for Windows and MAC, to help novice users get the samba up and running as quickly as possible. Do note that all the tips & tricks shared here is meant to get things up and running quickly, it might create security hole. Use at your own risk and be sure to research more if you are deploying for high security concern mission.

New created folder or copy & paste into samba shared folder do not follow permission set by smb.conf
The key settings are the following (e.g. permissions 775)
  • create mask = 0775
  • force create mode = 0775
  • security mask = 0775
  • force security mode = 0775
  • directory mask = 2775
  • force directory mode = 2775 (If you change this to 0755, it won't work. So this parameter is very important)
  • directory security mask = 2775
  • force directory security mode = 2775
Now, why 2775?
  • 2 = the setgid bit is set (2) which makes newly created directories have the same group ownership as the parent.
  • 77 = owners and group members of the files have full access to them
  • 5 = everyone else can enter the directories and view the file names (use with caution)
To be continue...

Saturday, October 12, 2013

Terminal does not have history and not showing path?

What happen when a new user's terminal (xterm, lxterminal etc):

  1. does not display any path (only show $>)
  2. does not support Up key for recall previous command?
It is because the new user is using /bin/sh instead of /bin/bash. To solve this, simply do sudo chsh, then key in /bin/bash when prompted to choose an option.

Restart the terminal then you should be able to get all the features back.

The root cause for this is nothing is specified when the user is being created using command line. Be sure to specify to use /bin/bash to avoid this.

Wednesday, August 7, 2013

Fast apt-get with apt-fast

Ever experience slow download even with 10Mbps++ internet? The author has written a very useful article to share how to speed everything up with apt-fast:

[Linux] file_mode, dir_mode or permission not working correctly in Samba Share or Mount folder

Users permission in Linux is really complicated, for samba share, you need to take care:

  1. the folder permission of the parents folder where your samba share is located (at server side)
  2. the folder permission of the parents folder where your fstab mounted folder is located
  3. the create mask and directory mask in /etc/samba/smb.conf on your server
  4. the file_mode, directory_mode, nopermrw and credentials in your /etc/fstab on client PC
General rules are parent folders permission will always overwrite the smb.conf & fstab

When do I need to check the parents folder permission?
  1. If you have set everything in both files and still cannot get the correct permission for new created file/directory in your samba shares. Check client PCs mount folder's parent's permission
  2. If client PCs has problem access the samba shares, even with the correct username & password entered. Check server samba share parent's folder permission
  3. When you need valid users = xxx, xxx to give access to client PCs. Check server samba share parent's folder permission
I have set the samba/fstab/parent folder permission, but I still don't have write permission?
  1. you need to add uid=***your current user name*** at the fstab mount option.
Known Issue
  1. When creating file/directory in the mount folder (using Ubuntu 12.10), it does not honor the create mask & directory mask set by the server's smb.conf. I'm still looking for a solution... appreciate if anyone can help.

Saturday, August 3, 2013

[Ubuntu] Can access samba network share by IP but not Netbios name from Windows

After whole long day of troubleshooting why we cannot resolve samba shared folders using the NetBIOS Name defined in smb.conf.. finally I have figured out the root of the problem:
Hostname CANNOT equal to NetBIOS name!!!
A bit of background...

  1. our server hostname is server1
  2. our NetBIOS name is server1 (defined in smb.conf)
  3. IP-address is 10.0.0.2

From Windows 7 / OSX we can access the samba shares using \\10.0.0.2\share, as well as \\server1.local\share (the .local is a result of running avahi-daemon). We can also ping 10.0.0.2 or server1 or server1.local, but we simply cannot access with \\server1\share

By changing the Hostname in /etc/hosts & /etc/hostname to any name other than "server1", or change the NetBIOS name in smb.conf to any other name, we can now get it work.

This is rather weird for a Windows user like me, where only hostname need to be set and we can access directly from other PC in the network without bothering what is NetBIOS. Linux is indeed too tricky!

Anyway, kind of fun when able to figure out what's wrong. It makes me love and hate Linux at the same moment!