⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 1543.html

📁 著名的linux英雄站点的文档打包
💻 HTML
📖 第 1 页 / 共 2 页
字号:
                    <TBODY>
                    <TR>
                        <TD vAlign=top width="80%"> 
                          <DIV align=center>
                        <FORM action="search.html" tppabs="http://www.linuxhero.com/docs/search.html" method=get>
                            </FORM>
                        <TABLE cellSpacing=0 cellPadding=0 width="95%" 
                          border=0><TBODY>
                          <TR>
                            <TD background="images/bgi.gif" tppabs="http://www.linuxhero.com/docs/images/bgi.gif" 
                          height=30></TD></TR></TBODY></TABLE>
                        <TABLE cellSpacing=0 cellPadding=3 width="95%" 
                        align=center border=0>
                          <TBODY>
                          <TR>
                            <TD>
                              <TABLE cellSpacing=0 cellPadding=3 width="100%" 
                              border=0>
                                <TBODY>
                                <TR>
                                      <TD vAlign=top> 
<p><FONT class=normalfont><B><font color=blue>samba使用大全----客户端</font></B></FONT><BR><FONT class=smallfont color=#ff9900>2004-04-23 15:18 pm</FONT><BR><FONT class=normalfont>作者:作者<br>来自:Linux知识宝库<br>联系方式:无名<br><br>使用Samba网络打印:<br>
使用unix网络打印以前的文章比较少涉及,最近试验了一下,效果还是不错的,现在讲讲基本的实现方法:<br>
比如你要建立一台网络打印机grind,而打印机对应网络上面的//glass/HPLaserj,所有需要配置的文件有下面几个:<br>
1./etc/printcap,内容一般为:<br>
grind:<br>
:sh: #禁止提示的header<br>
:ml=0: #打印的文件的长度下限,<br>
:mx=0: #最大的打印文件大小,0为不限制<br>
:sd=/var/spool/lpd/grind: #打印机的spool目录<br>
:lp=|/usr/bin/smbprint: #打印输出需要的设备名或者管道名<br>
:lpd_bounce=true: #强制lpd守护进程过滤打印文件<br>
:if=/usr/share/printconf/mf_wrapper: #过滤命令文件<br>
<br>
2.smbprint这个一般在安装完smb相关的rpm包以后就有了,主要内容是:<br>
eval acct_file=$$#<br>
spool_dir=`dirname $acct_file`<br>
config_file=$spool_dir/.config<br>
eval `cat $config_file`<br>
share=`echo $share | sed "s/[]///g"`<br>
if [ "$user" != "" ]; then<br>
usercmd="-U"<br>
else<br>
usercmd=""<br>
fi<br>
if [ "$workgroup" != "" ]; then<br>
workgroupcmd="-W"<br>
else<br>
workgroupcmd=""<br>
fi<br>
if [ "$translate" = "yes" ]; then<br>
command="translate ; print -"<br>
else<br>
command="print -"<br>
fi<br>
cat | /usr/bin/smbclient "$share" "$password" -E ${hostip:+-I}<br>
$hostip -N -P $usercmd "$user" $workgroupcmd "$workgroup"<br>
-c "$command" 2&gt;/dev/null<br><br>
3.mf_wrapper是一个magic filter文件,是相关的一些过滤规则。内容是:<br>
MF_RULE_DIR='/usr/share/printconf/mf_rules'<br>
MF_RULES=$MF_RULE_DIR/mf[[:digit:]][[:digit:]]-*<br>
TMP_FILE=`mktemp /tmp/printconf.XXXXXX`' 'exit 1<br>
cat ./mf.cfg $MF_RULES | m4 &gt; $TMP_FILE<br>
if [ -n "$DEBUG" ]; then<br>
case "$DEBUG" in<br>
2)<br>
DEBUGSTRING="--debug --debug"<br>
;;<br>
3)<br>
DEBUGSTRING="--debug --debug --debug"<br>
;; 4)<br>
DEBUGSTRING="--debug --debug --debug --debug"<br>
;;<br>
5)<br>
DEBUGSTRING="--debug --debug --debug --debug --debug"<br>
;;<br>
*)<br>
DEBUGSTRING="--debug"<br>
;;<br>
esac<br>
else<br>
DEBUGSTRING=""<br>
fi<br>
# Run magic filter<br>
/usr/bin/magicfilter-t $TMP_FILE $DEBUGSTRING $* &lt; /dev/stdin<br>
RETVAL=$?<br>
if [ -f $TMP_FILE ]; then<br>
rm -f $TMP_FILE;<br>
fi<br>
;;<br>
esac<br>
else<br>
DEBUGSTRING=""<br>
fi<br>
# Run magic filter<br>
/usr/bin/magicfilter-t $TMP_FILE $DEBUGSTRING $* &lt; /dev/stdin<br>
RETVAL=$?<br>
if [ -f $TMP_FILE ]; then<br>
rm -f $TMP_FILE;<br>
fi<br>
if [[ $RETVAL -eq 0 ]]; then<br>
TERMINATION=`grep '^[[:space:]]*#[[:space:]]*TERMINATION=' ./mf.cfg | se<br>
d 's/^[[:space:]]*#[[:space:]]*TERMINATION=//;'`<br>
if [ -n $TERMINATION ]; then<br>
echo -n -e $TERMINATION;<br>
fi<br>
fi<br>
同时需要在/var/spool/lpd/grind下面有这么两个文件:mf.cfg和script.cfg。<br>
mf.cfg的内容是:<br>
define(TEXTfilter, text ""<br>
14 )dnl<br>
define(PSfilter, `filter /usr/share/printconf/util/mf_postscript_wrapper --mfomatic -d lj5gray-75168.foo')dnl<br>
script.cfg的内容是:<br>
share="//glass/HPLaserj" #glass机器上面共享的打印机<br>
hostip="192.168.1.123" #glass这台机器的IP<br>
user=""<br>
password=""<br>
workgroup=""<br>
translate="no"<br>
完成这个工作后,启动lpd进程,然后就能用lpr等命令使用网络打印机打印了。<br>
<br>
使用网络共享文件资源:<br>
列出网络资源:<br>
一般可以用smbclient来列出某台机器相关的资源,smbclient的用法参考http://www.linuxaid.com.cn/training/tods/showtod.jsp?i=241。这里讲比较有用的使用方法:<br>
smbclient –L IP或者NETBIOS名称,作用是显示某台提供samba服务的服务器上的共享资源。命令执行效果如下:<br>
smbclient –L glass<br>
Sharename Type Comment<br>
--------- ---- -------<br>
IPC$ IPC 远程 IPC<br>
HPLaserJ Printer HP LaserJet 6P<br>
ADMIN$ Disk 远程管理<br>
littlep Disk<br>
C$ Disk 默认共享<br>
Server Comment<br>
--------- -------<br>
GLASS<br>
GRIND<br>
Workgroup Master<br>
--------- -------<br>
BLUESUN GLASS<br>
WORKGROUP HEIHEI<br>
第一段列举了该机器(glass)上面的共享资源,第二段列举了glass所在的工作组里面所有提供samba服务的机器,第三列举了其他工作组提供browse服务的Master机器(关于Master和Browse服务可以参考我的前面一篇samba使用大全-samba服务器)。<br>
使用网络资源:<br>
smbclient //IP或者NETBIOS名称/共享资源名 [-U 用户名]<br>
命令执行效果如下:<br>
smbclient //glass/littlep<br>
added interface ip=192.168.1.123 bcast=192.168.1.255 nmask=255.255.255.0<br>
Got a positive name query response from 192.168.1.123 (192.168.1.123)<br>
Password:<br>
Domain=[BLUESUN] OS=[Windows 5.0] Server=[Windows 2000 LAN Manager]<br>
smb: &gt;<br>
接下来的操作和ftp的时候命令一样,用get下载文件而用put上传文件,命令可以用help查看。<br>
还有一种方法是用文件系统的方式(这种方式要确定你的内核支持smbfs,如果没有支持的话,编译内核的时候必须选中File systems---&gt;Network File Systems---&gt; SMB file system support (to mount Windows shares etc.) ):<br>
smbmount //IP或者NETBIOS名称/共享资源名 /本地挂接点 [-o option]<br>
常用的的option有username=&lt;用户名&gt;,password=&lt;密码&gt;,guest(指定为用guest访问,不用提供密码,前面的即使用username=guest参数的话也会要求输入密码),ro(有时候为了系统安全要指定为只读模式),rw,同时多个option的话用逗号隔开。<br>
或者可以用mount –t smbfs [–o option] //IP或者NETBIOS名称/共享资源名 /本地挂接点来实现同样的功能。<br>
例子如下:<br>
smbmount //glass/littlep /test -o guest或者mount –t smbfs –o guest //glass/littlep /test,然后就能通过访问/test来使用网络上的资源了。<br>
如果不需要使用的时候,可以简单地使用smbumount /test或者umount /test来解除这个挂接。<br>
关于samba的功能(共享linux磁盘给Win95/NT、共享Linux打印机给win95/NT、共享win95/NT打印机给Linux机器、共享Win95/NT磁盘给Linux机器),前面两个属于samba服务器的内容而后两个属于samba客户段的内容,在我的两篇文章中都有介绍了他们的实现方法,但是samba实在是一个强大的工具,无法十分详细地介绍它地全部功能,而且限于笔者的知识有限,有不到之处请各位指出,还望各位多多交流。<br>
</FONT><br>
                                      </TD>
                                    </TR>
                                <TR>
                                <TD colSpan=2><FONT 
                                class=middlefont></FONT><BR>
                                        <FONT 
                                class=normalfont>全文结束</FONT> </TD>
                                    </TR>
                                <TR>
                                <TD background="images/dot.gif" tppabs="http://www.linuxhero.com/docs/images/dot.gif" colSpan=2 
                                height=10></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></DIV></TD>
                        <TD vAlign=top width="20%" 
                      background="images/line.gif" tppabs="http://www.linuxhero.com/docs/images/line.gif" rowSpan=2> 
                          <DIV align=center> 
                            <table class=tableoutline cellspacing=1 cellpadding=4 
                        width="100%" align=center border=0>
                              <tr class=firstalt> 
                                <td noWrap background="images/bgline.gif" tppabs="http://www.linuxhero.com/docs/images/bgline.gif" colspan=2 height=21>
                                <font class=normalfont><b>所有分类</b></font></td>
                              </tr>
<tr class=secondalt> <td noWrap width=27%> <font class=normalfont>1:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type1.html" tppabs="http://www.linuxhero.com/docs/type1.html">非技术类</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>2:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type2.html" tppabs="http://www.linuxhero.com/docs/type2.html">基础知识</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>3:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type3.html" tppabs="http://www.linuxhero.com/docs/type3.html">指令大全</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>4:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type4.html" tppabs="http://www.linuxhero.com/docs/type4.html">shell</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>5:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type5.html" tppabs="http://www.linuxhero.com/docs/type5.html">安装启动</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>6:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type6.html" tppabs="http://www.linuxhero.com/docs/type6.html">xwindow</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>7:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type7.html" tppabs="http://www.linuxhero.com/docs/type7.html">kde</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>8:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type8.html" tppabs="http://www.linuxhero.com/docs/type8.html">gnome</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>9:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type9.html" tppabs="http://www.linuxhero.com/docs/type9.html">输入法类</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>10:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type10.html" tppabs="http://www.linuxhero.com/docs/type10.html">美化汉化</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>11:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type11.html" tppabs="http://www.linuxhero.com/docs/type11.html">网络配置</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>12:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type12.html" tppabs="http://www.linuxhero.com/docs/type12.html">存储备份</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>13:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type13.html" tppabs="http://www.linuxhero.com/docs/type13.html">杂项工具</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>14:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type14.html" tppabs="http://www.linuxhero.com/docs/type14.html">编程技术</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>15:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type15.html" tppabs="http://www.linuxhero.com/docs/type15.html">网络安全</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>16:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type16.html" tppabs="http://www.linuxhero.com/docs/type16.html">内核技术</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>17:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type17.html" tppabs="http://www.linuxhero.com/docs/type17.html">速度优化</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>18:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type18.html" tppabs="http://www.linuxhero.com/docs/type18.html">apache</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>19:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type19.html" tppabs="http://www.linuxhero.com/docs/type19.html">email</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>20:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type20.html" tppabs="http://www.linuxhero.com/docs/type20.html">ftp服务</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>21:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type21.html" tppabs="http://www.linuxhero.com/docs/type21.html">cvs服务</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>22:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type22.html" tppabs="http://www.linuxhero.com/docs/type22.html">代理服务</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>23:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type23.html" tppabs="http://www.linuxhero.com/docs/type23.html">samba</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>24:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type24.html" tppabs="http://www.linuxhero.com/docs/type24.html">域名服务</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>25:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type25.html" tppabs="http://www.linuxhero.com/docs/type25.html">网络过滤</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>26:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type26.html" tppabs="http://www.linuxhero.com/docs/type26.html">其他服务</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>27:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type27.html" tppabs="http://www.linuxhero.com/docs/type27.html">nfs</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>28:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type28.html" tppabs="http://www.linuxhero.com/docs/type28.html">oracle</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>29:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type29.html" tppabs="http://www.linuxhero.com/docs/type29.html">dhcp</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>30:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type30.html" tppabs="http://www.linuxhero.com/docs/type30.html">mysql</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>31:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type31.html" tppabs="http://www.linuxhero.com/docs/type31.html">php</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>32:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type32.html" tppabs="http://www.linuxhero.com/docs/type32.html">ldap</a></font></td>    </tr>  </table></td></tr>                            </table>
                          </DIV></TD></TR>
                    <TR vAlign=top>
                        <TD width="80%"> 
                          <DIV align=center><BR>
                          </DIV>
                        </TD></TR></TBODY></TABLE></TD></TR>
                </TABLE></TD></TR>
          </TABLE>
      <TABLE cellSpacing=0 cellPadding=4 width="100%" bgColor=#eeeeee 
        border=0><TBODY>
        <TR>
          <TD width="50%">
              <P><FONT class=middlefont>版权所有 &copy; 2004 <A 
            href="mailto:bjchenxu@sina.com">linux知识宝库</A><BR>
                违者必究. </FONT></P>
            </TD>
          <TD width="50%">
              <DIV align=right><FONT class=middlefont>Powered by: <A 
            href="mailto:bjchenxu@sina.com">Linux知识宝库</A> Version 0.9.0 </FONT></DIV>
            </TD></TR></TBODY></TABLE>
      <CENTER></CENTER></TD></TR>
    </TABLE></CENTER></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -