Thoughts on Rails

Riding the Train of Thought

Archive for the ‘smb’ Category

Mounting samba share with write permissions for regular users

with 4 comments

I have tried looking for this information on the Internet but have successfully managed to make myself look dumb. I found nothing for three consecutive days (nights, actually – mostly I sleep in the day, work at night!) I proudly say this – “I may not know everything, but I know where to find it.” But these three days left me increasingly frustrated at the inability to solve a simple problem. Recent trends are showing that I am finding less and less relevant information in my searches. I’m afraid… am I losing the search-fu skillz?

So anyway, rants aside – this is what I was facing:

I have set up samba on my computer named Jaguar, it runs PCBSD 3.3, I wish to access the samba share from Panther, which also runs PCBSD 3.3. I can simply point Konqueror to “smb://192.168.0.2″ (the IP address belongs to Jaguar) and I am able to read and write to the share.

Trouble begins when I try to mount the share using mount_smbfs command. I have configured the share to be public, writable and also allowed guests – also, security is on share basis – so no passwords are required. I add the “-N” switch to my mount_smbfs command to disable password prompt.

mount_smbfs -N -I 192.168.0.2 //guest@192.168.0.2/shared /home/harshad/shared

It mounts the samba share, I am able to read the files… but I cannot write to them. And trying to solve this problem took a good amount of time. I know – it should be simple. And trust me – it is simple. You only have to know how to use two simple switches – “-g” and “-u”.

They tell mount what should be the group id and user id for the mounted filesystem. So, go ahead, look up your user id (uid) from /etc/passwd and group id (gid)for whichever group you wish to allow write access to and substitute in the following command:

mount_smbfs -N -u 1002 -g 10 -I 192.168.0.2 //guest@192.168.0.2/shared /home/harshad/shared

That sure fixed my problem – and I hope it can help you too.

Thanks to: ##FreeBSD channel on freenode.net (IRC)

Written by hiway

March 2, 2007 at 5:24 am

PCBSD, Samba and Amarok

leave a comment »

So my computers Jaguar and Panther (nothing to do with MacOS) are running PCBSD for over 50 days now. Cheetah has been on FreeBSD since ages. I’m no sure what I run on, but the BSDs surely have something against me.

It is said that PCBSD makes it easy to share files like in MSWindows… right click on a folder, go to sharing tab… but for me the tab isn’t visible anymore… probably because i recompiled the kernel – because my printer was not going to work without that step, which included downloading the complete source code (FreeBSD comes with this stuff, but I can understand…) anyway… so the sharing tab isnt visible anymore. But when it was, I tried clicking on the settings button which supposedly opens another window… which never opened.

So… after a few deep sighs and a few cups of assam tea, I decided to go the old way – set up smb.conf on Jaguar by hand and using mount_smbfs on other machines. Followed the steps from http://www.freebsddiary.org/samba.php and got it running. I could see the files from Panther in konkueror (smb://10.0.0.4/share) and when I tried to open a file, Konqueror asked me if I wanted to download the file or open it in the related application. That was confusing, and after making up my mind, I decided to open the file instead of downloading it. Well, the file was downloaded to a temporary folder and then opened in the application. Blah! Well, after editing the file, I closed the application and the system asked me if I wanted to upload the file back again. Smart. But not smart enough.

I remembered using mount_smbfs command on FreeBSD and it never bothered me like this. Infact, I remember windows never bothered me with such questions either. For once, I had to accept that that OS is maybe a bit friendly. But then I remebered the horrors of setting up the network under windows… and I felt better. Hehe.

I tried the command but it was not allowing me to connect – authentication error, it barked back. Looked around, could not find anything that would help me, so I went through the smb.conf files available on the internet and came across “security=share” clause under [global] section of the file. Somehow it clicked… I put that in the conf file and restarted smbd… checked mount_smbfs from Panther and voila! it worked!

That’s for the adventure right in the first few hours of my day – who knows what’s left in the day!

Written by hiway

February 21, 2007 at 12:49 pm

Follow

Get every new post delivered to your Inbox.