Mounting SMB/CIFS shares in OpenBSD
yes!, it works!
Found how just some minutes ago. I was preparing a backup solution for a windows-based network using OpenBSD and rdiff-backup. The idea is very simple:
Some windows workstations store some data into a windows (or unix+samba) file server. The data needs to be backed up, just in case. All the information we will backup regularly are the user profiles and a backup directory shared through the whole network (so everyone could put in there everything they need to backup).
As those shares/folders/directories are exported using the SMB/CIFS protocol, I can mount them in the OpenBSD host using sharity-light, an userland implementation of smbfs (which operates in kernel space).
To mount a windows share using sharity-light, you only need an empty directory on your filesystem and do something like:
# shlight //windowsserver/backup /mnt/backup -U windows_user -P someuglypassword
NOTE: here windowsserver is a name pointing to the ip address of the windows server, while windows_user and someuglypassword are the user credentials needed to access (in this case) the backup share.
NOTE2: sharity does not allow ip addresses as the server name, and it will fail if you try to use the server.domain.ext naming convention, so you will probably need to add something like that to your /etc/hosts file:
192.168.1.111 windowsserver.mydomain.net windowsserver
After using calling the shlight script, you will be able to access the windows share just as any other mounted file system in OpenBSD:
# df -h
Filesystem Size Used Avail Capacity Mounted on
[ ... ]
shlight-31463 298G 93.8G 204G 31% /mnt/backup
In my case, now I can safety run rdiff-backup to create an easy-to-recover full backup (with incrementals) on my local filesystem.
I trying to use sharity-light whit Windows XP, but i have this error when i run the shlight command:
Kernel: smb_receive_raw: Invalid packet 0x83
Kernel: smb_receive: receive error: -5
Kernel: smb_proc_connect: Failed to send SESSION REQUEST.
error connecting to server:  Input/output error
In the FAQ say:
Q: Mounting a share with Sharity-Light results in the following error
error connecting to server:  I/O error
A: Sharity-Light is not very good in giving diagnostic messages when
something goes wrong. The above can mean almost anything. You should
- The share is correctly imported.
- The server is in user- or share level security (and use the
- If you have NT4 with service pack 3 or any newer NT product:
Whether you have enabled unencrypted passwords (Sharity-Light can't
do password encryption).
In your implementation, you have this error?
You have any suggestion?
I fact, I did suffer such problem in one of the implementations. It is related to one configuration parameter in the windows machine. I don't remember actually the exact name, but it has something to do with the way the windows machine manage the password verification (something like "force encrypted password transmission" or similar. You should take a look over the administrative tools of the XP machine.
You can search for that in google, seems like a usual problem even with smbclient/samba and Linux too.
There are no trackbacks.