Skip to Content

利用Samba-TNG套件实现Puppy linux与windows的共享互访

此篇教程来自Puppy linux的官方英文论坛:http://www.murga-linux.com/puppy/
以下是借助谷哥翻译,按自已的理解整理出来的,文章翻译到这儿时,我也一边作尝试,突然发现,我这段时间以来一直纠结的这个samba与windows共享互访问题,已得到解决方案。真是高兴啊~~~......(文中提到的附件我随后提供或到原帖地址下载,我用的PUPPY版本为precise5.5)

How to Use Samba-TNG Server in Puppy?
如何在Puppy上使用Samba-TNG服务器?


In order for a Puppy machine to share its files across a network, it must run some kind of server. This could be an FTP or HTTP server, but the most versatile choice is Samba. Samba can be used to make a simple NAS file sharing box or to build a full multi-user client-server system.
装有puppy的电脑,分享其在网络上的文件时,它必须运行某种类型的服务器。这可能是一个FTP或HTTP服务器,但最通用的选择是samba。 Samba可以用来做一个简单的NAS文件共享,或者建立一个完整的多用户客户端 - 服务器系统。

Samba-TNG is a fork of the official Samba project. It is much smaller and is satisfactory for home networks. Here are the setup instructions:
Samba-TNG是官方的Samba项目的一个分支。它是很小,作为家庭网络使用是令人满意的。下面是安装说明:

Install the samba-tng-rcrsn-0.5-rc1.pet attached below.
安装在下面的附件samba-TNG rcrsn-0.5-rc1.pet

Open a terminal and run: samba-start
打开一个终端,输入运行:samba-start

The server's name is pupserver and the share's name is pupshare. The default user is root with password woofwoof. The share is currently set to the server's /mnt/home folder and is writable by clients.
这服务器的名称是pupserver及共享的名称是pupshare。默认用户是root密码woofwoof。目前共享设置为服务器的 /mnt/home文件夹,客户端是可写的。

Depending on your Puppy installation method, you may not have a /mnt/home folder. If so, edit the smb.conf file (see below) so that pupshare points to an existing folder. For test purposes, just use /root.
根据您的puppy安装方法,你可能不会看到 /mnt /home这个文件夹。如果这样,请编辑smb.conf文件(见下文)使pupshare指向现有文件夹。出于测试目的,只是使用 /root。


Please note: Running the Puppy firewall on a Samba server machine will block it from clients. If you really want to run a firewall, you must do a custom install that opens the following ports: 135/tcp 137/udp 138/udp 139/tcp 445/tcp.

请注意:在Samba服务器机器上运行的Puppy防火墙将阻止的它客户端访问。如果你真的想运行一个防火墙,你必须做一个自定义安装,打开以下端口:135/TCP137/UDP138/UDP139/TCP445/TCP。

From a Puppy client, you can access the server with Pnethood. For a faster share mounting tool, look at YASSM.
从Puppy客户端,您可以用Pnethood访问服务器。对于一个更快的分享安装工具,可以看看这个YASSM。

On a Windows client, create a shortcut on the desktop and make the location \\pupserver. Note that this name starts with two back-slashes.
在Windows客户端,在桌面上创建一个快捷方式,位置是\\pupserver。需要注意的是这个名字开始与两个反斜线。

The Puppy server's default workgroup name is pupgroup. Depending on the version of Windows, you may need to change the workgroup name in smb.conf (see below) to match that of your Windows clients. Some common names are WORKGROUP or MSHOME.
Puppy服务器的默认工作组名称是pupgroup。根据不同版本的Windows,你可能需要在smb.conf中更改工作组名称(见下文),以匹配您的Windows客户端。一些常见的名字是WORKGROUP或MSHOME。

The server's configuration file is /usr/local/samba/etc/smb.conf. You can edit it to change the share folder or to add additional shares.
After editing the smb.conf, stop the server with samba-stop and restart it with samba-start.
A useful command when working with Samba is ps. You should see the group of ten Samba daemons running.

服务器的配置文件是/usr/local/samba/etc/smb.conf文件,您可以编辑更改共享文件夹或添加额外共享。
编辑smb.conf文件后,终端输入"samba-stop"停止samba服务,然后终端输入"samba-start"重新启动samba服务。
与Samba工作时,一个有用的命令是ps。您应该看到一群Samba守护进程运行。

未完,待续~~~
#13087
哈哈哈~~~真是太高兴了!翻译到此,也一边尝试。没想到一直想得到的效果出来了!

windows xp可以在网上邻居里访问Puppy的共享文件夹了。原来这么简单?
#13088
原帖地址找到:http://www.murga-linux.com/puppy/viewtopic.php?t=60204

接一楼内容:
Avoid making changes to the server while clients are connected. This can cause hangups that will require rebooting to clear. If Samba starts to behave strangely, shut down any client machines and restart the Samba server.
当客户端连接到服务器时要避免更改,这可能会导致挂断,同时需要重新启动服务来清除。如果Samba开始出现奇怪现象,任何客户端都会导致Samba服务器关掉或者重新启动。

The Samba-TNG package contains the utility program rpcclient. Use it to create additional Samba users. For example:
在Samba-TNG包里含有实用程序rpcclient,可用它来创建额外的Samba用户。例如:
代码:
rpcclient
$help
$enumusers
$createuser spot -p barkbark
$quit

Any new Samba users you create must already exist as Puppy users. Also, Samba must be running in order for rpcclient to work.
您创建任何新的Samba用户必须已经是Puppy用户。此外,Samba必须运行以便rpcclient工作。

In the above default configuration, all the shares you create are public. But you might want to give each user their own private folder on the server. Here's how:
在上面的默认配置中,你创建的所有的共享都是公开的。不过,你可以给每个用户在服务器上拥有自已的私人文件夹。具体方法如下:

1. Create a Puppy user named Fred:
创建一个名为弗雷德的Puppy用户:
代码:
adduser -D -h /mnt/home/fred fred

2. To verify that you have made Fred's account correctly, type:
为了验证弗雷德帐户是否正确,请键入:
代码:
ls -lH /mnt/home

There should be an entry for fred with fred:fred ownership. If you make a mistake, type deluser fred and try again.
应该有一个条目为弗雷德:弗雷德私人所有。如果你犯了一个错误,键入“deluser fred”命令然后再试一次。
#13089
3. Create Fred as a Samba user with rpcclient. Note that the Samba user Fred requires a password, but the Puppy user Fred does not.
用rpcclient创建弗雷德Samba用户时,请注意,Samba用户弗雷德需要密码,而Puppy用户弗雷德没有。

4. Add an entry to smb.conf:
在smb.conf文件中添加一项记录
代码:
[fred]
path = /mnt/home/fred
writable = yes
valid users = fred

5. Restart the Samba server, go to a client machine and login as Fred.
重新启动Samba服务器,到客户机以弗雷德身份登录。

You may want a setup where no initial login is required. Open your smb.conf and uncomment the "map to guest" line by removing the semicolon.
您可能需要对初始登录进行设置。打开smb.conf文件,找到“map to guest”行删除分号。
代码:
[global]
security = user
map to guest = Bad Password

Or you might want a read-only public folder.
或者,你可能想要一个只读的公共文件夹。
代码:
[public]
path = /mnt/home/public
guest ok = yes
read only = yes

To let anyone write to the public folder, use
为了让任何对公共文件夹有写权限,请使用
代码:
[public]
path = /mnt/home/public
guest ok = yes
writable = yes
force user = root



To auto-start the Samba server at bootup, install the samba-autostart-1.1.pet below. It puts a script in /root/Startup that waits until your network is active, then runs samba-start. You can also use the script to mount any drives that you want to share.
想要在开机时自动启动Samba服务器,安装下面的这个附件:samba-autostart-1.1.pet。它在 /root /Startup里放入一个启动脚本,等待你的网络激活,然后运行samba。您还可以使用脚本来安装任何驱动器共享。

Or you can try adding the script to your rc.local. Then you could boot Puppy with the "pfix=nox,fsck" argument and run headless! And, if you don't mind working from the command line, you can install Openssh on the server and manage it remotely.
或者你可以尝试将脚本添加到您的rc.local中。然后,你可以在Puppy开始启动时以“Pfix=nox,fsck”的参数来运行(run headless这不太懂,见谅哈!)而且,如果你不介意工作在命令行中,你可以安装Openssh在服务器上进行远程管理。
#13090
Samba keeps its own set of passwords - it doesn't care about the Puppy versions. So you might want to change the Samba server root password to something more secure than "woofwoof".
Samba保持其自己的一套密码 - 它不关心的Puppy的版本。所以,你可能会想修改Samba服务器root的密码比“woofwoof”更安全些的。
代码:
rpcclient
$deluser root
$createuser root -p newpassword
$quit


------------------------------------------
Using Samba-TNG as a Network Print Server
使用Samba-TNG来作为网络打印服务器

Note #1: To enable print sharing in newer Puppies like Lupu, you must make a change to the smb.conf. In the [global] section, locate the line printcap name = cups and uncomment it by removing the semicolon.
注意1:为了使用打印共享,在新的Puppy版本里像Lupu,你必须对smb.conf进行改。在[global]部分中,找到该行printcap name = cups,并取消它前面的分号。


Note #2: If your Puppy server is running CUPS 1.3.11, you need to modify its configuration. Locate the file /etc/cups/mime.convs. At the end of the file, uncomment the line
注意2:如果您的Puppy服务器运行CUPS 1.3.11,你需要修改它的配置。找到文件/etc/cups/mime.convs在该文件的末尾,取消该行
代码:
application/octet-stream application/vnd.cups-raw


Restart CUPS.
重新启动CUPS。

A Samba server can share its attached printer(s) with clients on the network. And it does so by the printer's assigned name instead of by IP address. So if your server changes its IP address, the clients can still locate the printer.
一个Samba服务器可以在网络上与客户分享其连接的打印机。它通过指定打印机的名称,而不是通过IP地址。因此,如果你的服务器更改其IP地址,客户端仍然可以找到打印机。

Your first step is to install the printer in the server's CUPS as a local device. Keep the name short - less than 16 characters. Otherwise, the Windows clients may not be able to detect it.
你第一步首先安装打印服务器的CUPS来作为本地设备。保持短的名字 - 少于16个字符。否则,Windows客户端可能无法检测到它。

You do NOT need to declare the printer as sharable. (You would only use that feature if CUPS was going to handle the network printing.)
你不需要申报打印机共享。 (你只会使用该功能,如果CUPS将要处理网络打印时)。
#13091
Whenever you make changes to your printer setup, restart Samba to ensure that the printers will be visible on the network.
每当你做出更改打印机设置,重新启动Samba,以确保打印机在网络上可见。

There is one small catch to this setup. If you have enabled initial logins, then a Windows client MUST login to access the printer. However, a Puppy client can use the printer without logging in.
这种设置有一个小小的好处。如果您已启用初始登录,那么某个Windows MUST客户端必须登录访问打印机。然而,某个Puppy客户端却可以不用登录而使用打印机。

To set up a Linux Client:
要建立一个Linux客户端:

Users who have set up Windows shared printers are familiar with the CUPS smb backend. This type of backend is also needed to access a Samba printer and there are several variations available in different Puppies. Use the URI:
通过CUPS smb后端用户已经熟悉了设置Windows共享打印机。这种类型的后端也需要访问Samba打印机,并在不同的Puppy版本中有变化。使用URI:
代码:
smbc://pupserver/printer_name

When you select the make and model of your printer, use Raw and Raw-Queue. This declares that the print job will be sent directly to the Samba server, whose CUPS will then do the formatting. You don't need to install a printer driver package on the client machine. However, in certain Puppy client/server combinations, this may still be necessary.
当您选择您的打印机的品牌和型号,使用原材料和原材料队列。此声明的打印作业将被直接发送到Samba服务器,CUPS将做格式化。你不需要在客户机上安装一个打印机驱动程序软件包。然而,在某些Puppy的客户机与服务器的组合,这可能仍然是必要的。


To set up a Windows Client:

Start the Add Printer Wizard
Select: Local printer (even though it's not)
UNcheck the option to automatically detect a PnP printer
Select: Create new port
Select: Local port
Enter the port name as: \\servername\printername
Install the Windows printer driver as usual

要建立一个Windows客户端:

启动“添加打印机向导”
选择:本地打印机(即使它不是)
取消该选项自动检测即插即用打印机
选择:创建新端口:
选择:本地端口:
输入端口名称为:\ \服务器名\打印机名
安装Windows打印机驱动程序像往常一样


Some Windows drivers may not work across a network because they need to have direct contact with the printer before they will start a print job. In that case, install the printer under Windows as an HP Color Laserjet PS. This will format the print job using the Postscript printer language, which the server's CUPS will happily process. You can use the same technique with Macs.
一些Windows驱动程序可能无法正常工作,因为他们需要在网络上与打印机直接接触之前,他们将开始一个打印作业。在这种情况下,Windows下安装一个HP COLOR LASERJET PS彩色打印机。这将使用PostScript的打印机语言,服务器会很乐意处理格式化的打印作业。对于苹果电脑您可以使用相同的技术对。


If you are building a dedicated file server and want very simple print server functionality, read here.
如果你是建立一个专用的文件服务器和想很简单打印服务器功能,在这儿(http://www.murga-linux.com/puppy/viewtopic.php?p=455543#455543)阅读


附件下载:
---------------------------------------------------------------------
samba-tng-rcrsn-0.5-rc1.pe
http://www.murga-linux.com/puppy/viewtopic.php?mode=attach&id=33013

samba-autostart-1.1.pet
http://www.murga-linux.com/puppy/viewtopic.php?mode=attach&id=56761
#13092
晕~
开发之家的这个论坛程序不好用哦。
#13097
这么好的东东没人用?
#13147
重点总结:
1.samba服务器的配置文件是/usr/local/samba/etc/smb.conf
2.samba-start #启动服务
3.samba-stop #停止服务
4.samba-restart #重启服务
5.在Samba服务器机器上运行的Puppy防火墙将阻止的它客户端访问。如果你真的想运行一个防火墙,你必须做一个自定义安装,打开以下端口:135/TCP137/UDP138/UDP139/TCP445/TCP。
6.配置文件示例:
-----------------------
[global]
dos charset = CP936
unix charset = UTF8
display charset = UTF8
dns proxy = no
max log size = 50
domain master = no
domain logons = no
workgroup = WORKGROUP
netbios name = pupserver
server string = Puppy Linux
security = user
map to guest = Bad Password
;valid users = %S
;browseable = yes

;printcap name = cups
load printers = yes
[pupshare]
path = /root/Downloads
browseable = yes
guest ok = yes
writable = yes


[printers]
path = /tmp
printable = yes
guest ok = yes
#13189
好开心!谢谢你的翻译
#16082
Howdy this is kinda of off topic but I was wondering if blogs use WYSIWYG editors or if you have to manually code with HTML. I'm starting a blog soon but have no coding expertise so I wanted to get guidance from someone with experience. Any help would be enormously appreciated!
<a href="http://www.pushtheenvelope.co.uk/images/config.php?Face-à-Nike-Runnings-t-3791_8586.html" >Face à Nike Runnings</a>

发表新评论

  • 你可以在文本中使用BBCode标记语言。 URL会自动被转为链接。

更多关於格式化选项的信息

CAPTCHA
请验证您是否是机器人。
Image CAPTCHA
Enter the characters shown in the image.