File: micro.html

package info (click to toggle)
lg-issue19 5-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,396 kB
  • ctags: 122
  • sloc: sh: 103; makefile: 34
file content (159 lines) | stat: -rw-r--r-- 5,963 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
<!--startcut ==========================================================-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<title>Using SAMBA to Mount Windows Issue 19</title>
</HEAD>
<BODY BGCOLOR="#EEE1CC" TEXT="#000000" LINK="#0000FF" VLINK="#0020F0"
ALINK="#FF0000">
<!--endcut ============================================================-->

<H4>
&quot;Linux Gazette...<I>making Linux just a little more fun!</I>&quot;
</H4>

<P> <HR> <P> 
<!--===================================================================-->

<center>
<H2>Using SAMBA to Mount Windows 95</H2>
<H4>By Jonathon Stroud,
<a href="mailto:jgstroud@eos.ncsu.edu">jgstroud@eos.ncsu.edu</a></H4>
</center>
<P><HR>
<p>Many major universities are now offering network connections to
students in their rooms. This is really a wonderful thing for the
Linux community. Whereas, the majority of student owned computers
on these networks are still running Windows 95, many students are
making the switch to Linux. One thing that 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 trying to tell them that there is nothing that Linux can
not do, yet they continue to come to me and ask if they can do
this in Linux, or if they can do that. I have never once answered
no.

<h3>Samba</h3>

<p>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 obtain a copy from the Samba home page at
http://lake.canberra.edu.au/pub/samba/. 


<h3>Mounting Windows 95 Shares</h3>

<p>The first thing you will probably want to do, is check to see
what directories are shared on the computer you are trying to
mount off of.  To do this type smbclient -L computername. This
will list all the directories shared by the machine. To mount the
directory, we use the command smbmount. Smbmount can be a little
tricky though. I have created a script, named smb, that allows
users to mount drives using smbmount, with relative ease.

<pre>   #usage  smb computername sharename
   #!/bin/sh
   if [ $UID = 0 ]; then
      if [ ! d /mnt/$1 ]; then
         mkdir /mnt/$1
      fi
   #You may want to add the -u option here also if you need to 
   #specify a login id (ie: mounting drives on Windows NT)
      /usr/sbin/smbmount //$1/$2 /mnt/$1 I $1 c etc
   else
      if [ ! d ~/mnt/ ]; then
         mkdir ~/mnt/
      fi
      if [ ! d ~/mnt/$1 ]; then
         mkdir ~/mnt/$1
      fi
   #You may want to add the -u option here also if you need to 
   #specify a login id (ie: mounting drives on Windows NT)
      /usr/sbin/smbmount //$1/$2 ~/mnt/$1 I $1 c etcfi</pre>

<p>To execute this script you simply type smb followed by the name
of the computer you are mounting off of, and then the directory
you wish to mount (ex. smb workstation files). If you are root,
the script creates a directory in /mnt by the same name as the
computer, and mounts the directory there. For any other user, the
script makes a directory in the users home directory named mnt.
In that directory it makes another directory by the same name as
the computer and mounts the share there.

<h3>Sharing files with Windows 95</h3>

<p>Now to share a file. This also is not too difficult. To share a
directory you need to edit /etc/smb.conf. By default, Samba
shares users' home directories, but they are only visible (and
accessible) to the owner. This means that the person accessing
the share should be logged into Windows 95 with the same loginid,
as they use to log into your Linux box. 

<p>Let's say you want to let 'bob' access the directory
'/shares/files', and you do not want anyone else to access it. To
do this, add these lines to your /etc/smb.conf file.

<pre>   [bobsfiles]
      comment = files for bob
      path = /shares/files
      valid users = bob
      public = no
      writable = yes
      printable = no</pre>

<ol>
<li> indicates the name the directory will be shared under. 

<li> is a comment that can be displayed in the Windows 95
Network Neighborhood.

<li> lists the directory on your computer that will be shared

<li> when set to yes allows users to access the directory with
guest privileges.

<li> indicates whether or not the user has write permissions to
the indicated directory

<li> when set to yes allows users to spool print jobs from that
directory
</ol>

<p>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 man smb.conf.

<h3>More cool Samba stuff</h3>

<p>If a Windows 95 user on your network is running winpopup (an
instant massaging program), you can send them a winpopup message
using Samba. To do this just type <pre>smbclient -M computername
message_text</pre>.



<!--===================================================================-->
<P> <hr> <P> 
<center><H5>Copyright &copy; 1997, Jonathon Stroud<BR> 
Published in Issue 19 of the Linux Gazette, July 1997</H5></center>

<!--===================================================================-->
<P> <hr> <P> 
<A HREF="./index.html"><IMG ALIGN=BOTTOM SRC="../gx/indexnew.gif" 
ALT="[ TABLE OF CONTENTS ]"></A>
<A HREF="../index.html"><IMG ALIGN=BOTTOM SRC="../gx/homenew.gif"
ALT="[ FRONT PAGE ]"></A>
<A HREF="./python.html"><IMG SRC="../gx/back2.gif"
ALT=" Back "></A>
<A HREF="./lg_backpage19.html"><IMG SRC="../gx/fwd.gif" ALT=" Next "></A>
<P> <hr> <P> 
<!--startcut ==========================================================-->
</BODY>
</HTML>
<!--endcut ============================================================-->