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 Salt Stack and Vagrant for Drupal Development||May 20, 2013|
|Making Linux and Android Get Along (It's Not as Hard as It Sounds)||May 16, 2013|
|Drupal Is a Framework: Why Everyone Needs to Understand This||May 15, 2013|
|Home, My Backup Data Center||May 13, 2013|
|Non-Linux FOSS: Seashore||May 10, 2013|
|Trying to Tame the Tablet||May 08, 2013|
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Using Salt Stack and Vagrant for Drupal Development
- New Products
- Validate an E-Mail Address with PHP, the Right Way
- Drupal Is a Framework: Why Everyone Needs to Understand This
- A Topic for Discussion - Open Source Feature-Richness?
- Home, My Backup Data Center
- New Products
- Tech Tip: Really Simple HTTP Server with Python
- RSS Feeds
- Find new cell phone and tablet pc
8 min 15 sec ago
1 hour 37 min ago
- Automatically updating Guest Additions
2 hours 45 min ago
- I like your topic on android
3 hours 32 min ago
- Reply to comment | Linux Journal
3 hours 53 min ago
- This is the easiest tutorial
10 hours 7 min ago
- Ahh, the Koolaid.
15 hours 46 min ago
- git-annex assistant
21 hours 45 min ago
- direct cable connection
22 hours 8 min ago
- Agreed on AirDroid. With my
22 hours 18 min ago
Enter to Win an Adafruit Prototyping Pi Plate Kit for Raspberry Pi
It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Prototyping Pi Plate Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- Next winner announced on 5-21-13!
Free Webinar: Linux Backup and Recovery
Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.
In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.