Using SAMBA to Mount Windows 95
Many major universities are now offering network connections to students in their rooms. This is a wonderful opportunity for the Linux community. Even though the majority of student-owned computers on these networks are still running Windows 95, many students are making the switch to Linux. One question newcomers to Linux are constantly asking is, “Can I access a directory shared by a Windows 95 computer in the Network Neighborhood, and can I share files to Windows 95 users?” The answer, of course, is “Yes.” I keep telling them there is nothing that Linux cannot do, yet they continue to come to me and ask if they can do this or that in Linux. I have never once answered “No”.
To mount a Windows 95 share, we use a program called SAMBA. SAMBA is a program that allows Linux to talk to computers running Windows for Workgroups, Windows 95, Windows NT, Mac OS and Novel Netware. SAMBA even allows you to share a printer between computers using these different operating systems. SAMBA comes with most distributions of Linux, but if you do not have it installed, you can download it from the SAMBA home page at http://lake.canberra.edu.au/pub/samba/.
The first thing to do is check to see which directories are shared on the computer you are using. To do this, type:
This command lists all of the shared directories. To mount the desired directory, use the command smbmount, which can be a bit tricky. I have created a script, named smb, that allows users to mount drives using smbmount with relative ease. That script is shown in Listing 1. smb Script
To execute this script you simply type smb followed by the name of your computer and the directory you wish to mount (for example, smb workstation files). If you are root, the script creates a directory in /mnt with the same name as the computer and mounts the directory in that location. For any other user, the script creates a directory in the users home directory named /mnt. In that directory, smb creates another directory with the same name as the computer and mounts the shared directory there.
Sharing a file is not too difficult. To share a directory you need to edit the /etc/smb.conf file. By default, Samba shares users' home directories, but they are only visible (and accessible) to the owner. This means the person accessing the shared files must be logged into Windows 95 with the same login ID as he used to log into the Linux box.
In order to let the user bob and only the user bob access the directory /shares/files, add the following lines to your /etc/smb.conf file:
1 [bobsfiles] 2 comment = files for bob 3 path = /shares/files 4 valid users = bob 5 public = no 6 writable = yes 7 printable = no
Here's a line by line look at this example.
Specifies the name to be used for the shared directories.
Specifies a comment to be displayed in the Windows 95 Network Neighborhood.
Specifies the name of the directory on your computer to be shared.
Sets bob as the only valid user.
Specifies no public access. When set to yes, users are allowed to access the directory with guest privileges.
Indicates whether or not the user has write permissions to the shared directory.
Specifies that file cannot be printed. When set to yes, users are allowed to spool print jobs from the shared directory.
More examples on sharing files can be found in the default smb.conf file. For more help on setting up this file, see the Samba web page or type:
If a Windows 95 user on your network is running winpopup (an instant messaging program), you can send them a winpopup message using Samba. To do this just type:
and the contents of message_text will be displayed in a message window on computername.
This article was first published in Issue 19 of LinuxGazette.com, an on-line e-zine formerly published by Linux Journal.
|Using tshark to Watch and Inspect Network Traffic||Aug 31, 2015|
|Where's That Pesky Hidden Word?||Aug 28, 2015|
|A Project to Guarantee Better Security for Open-Source Projects||Aug 27, 2015|
|Concerning Containers' Connections: on Docker Networking||Aug 26, 2015|
|My Network Go-Bag||Aug 24, 2015|
|Doing Astronomy with Python||Aug 19, 2015|
- Using tshark to Watch and Inspect Network Traffic
- Problems with Ubuntu's Software Center and How Canonical Plans to Fix Them
- Concerning Containers' Connections: on Docker Networking
- A Project to Guarantee Better Security for Open-Source Projects
- Where's That Pesky Hidden Word?
- Firefox Security Exploit Targets Linux Users and Web Developers
- My Network Go-Bag
- Doing Astronomy with Python
- Build a “Virtual SuperComputer” with Process Virtualization
- diff -u: What's New in Kernel Development