特殊:Badtitle/NS100:Swat:修订间差异
小无编辑摘要 |
小无编辑摘要 |
||
(未显示同一用户的4个中间版本) | |||
第5行: | 第5行: | ||
* ''How to actually use Swat is outside the scope of this document, but [http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/SWAT.html#id2651818 http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/SWAT.html#id2651818] is a good place to get started. | * ''How to actually use Swat is outside the scope of this document, but [http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/SWAT.html#id2651818 http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/SWAT.html#id2651818] is a good place to get started. | ||
=== Installing Swat === | === Installing Swat === | ||
<ol><li><code><nowiki>sudo apt-get install swat</nowiki></code> | <ol><li><code><nowiki>sudo apt-get install swat xinetd</nowiki></code> | ||
</li><li><code><nowiki>sudo nano /etc/xinetd.d/swat</nowiki></code> | </li><li><code><nowiki>sudo nano /etc/xinetd.d/swat</nowiki></code> | ||
</li><li>Insert the following text (borrowed from [http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/SWAT.html#xinetd http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/SWAT.html#xinetd]):</li></ol> | </li><li>Insert the following text (borrowed from [http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/SWAT.html#xinetd http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/SWAT.html#xinetd]):</li></ol> | ||
<pre><nowiki># default: off | <pre><nowiki> | ||
# default: off | |||
# description: SWAT is the Samba Web Admin Tool. Use swat \ | # description: SWAT is the Samba Web Admin Tool. Use swat \ | ||
# to configure your Samba server. To use SWAT, \ | # to configure your Samba server. To use SWAT, \ | ||
第18行: | 第19行: | ||
socket_type = stream | socket_type = stream | ||
wait = no | wait = no | ||
only_from = localhost | # Use only_from if you want to restrict access | ||
# only_from = localhost | |||
user = root | user = root | ||
server = /usr/sbin/swat | server = /usr/sbin/swat | ||
第43行: | 第45行: | ||
''kudos to fabioleitao for the answer, http://ubuntuforums.org/showpost.php?p=980625&postcount=8'' | ''kudos to fabioleitao for the answer, http://ubuntuforums.org/showpost.php?p=980625&postcount=8'' | ||
Q: The swat help links do not work. How do I tell swat where to find the man pages? | Q: The swat help links do not work. How do I tell swat where to find the man pages? | ||
A: You don’t have to tell swat where they are you have to install them. | |||
<pre><nowiki> | |||
sudo apt-get install samba-doc | |||
</nowiki></pre> | |||
Q: When I open the web page I only see four boxes (Home, Status, View, Password) but none of these boxes give me the ability to configure Samba. What should I do? | |||
A: You do not have the necessary permissions. You will need to ensure you are a user of the administration group (‘admin’) and that the adm group has sufficient access rights to the Samba configuration file (‘smb.conf’). Note the user created during the installation is automatically a member of the adm group. | |||
To ensure the adm group has proper permissions over ‘smb.conf’ use ‘chmod’ and ‘chgrp’ tools to change the file access permissions and group permissions respectively: | |||
<pre><nowiki> | |||
sudo chmod g+w /etc/samba/smb.conf | |||
sudo chgrp adm /etc/samba/smb.conf | |||
</nowiki></pre> | |||
Another method is to grant all users—the whole world essentially—complete access to ‘smb.conf’. This is '''not''' recommended for obvious security reasons. | |||
<pre><nowiki> | |||
sudo chmod 777 /etc/samba/smb.conf | |||
</nowiki></pre> | |||
Now refresh your browser window and you should see additional boxes for Globals, Shares, Printers and Wizard. | |||
Q: On my 6.06 LTS server clients don't see the swat page. It is just a blank page. What now? | |||
A: Edit the /etc/samba/smb.conf file so that the file contains a line for allowed hosts like: | |||
<pre><nowiki> | |||
sudo vi /etc/samba/smb.conf | |||
</nowiki></pre> | |||
or, if you are not that comfortable with vi: | |||
<pre><nowiki> | |||
sudo nano /etc/samba/smb.conf | |||
</nowiki></pre> | |||
Add or change the following line: | |||
<pre><nowiki> | |||
[global] | |||
...... | |||
....... | |||
hosts allow = 192.168.1.0/255.255.255.0 | |||
[printers] | |||
</nowiki></pre> | |||
Of course this has to match your own network settings. After this you have to restart the samba subsystem. | |||
<pre><nowiki> | |||
sudo /etc/init.d/samba restart | |||
</nowiki></pre> | |||
Q: On my 9.04 Server i can't access swat. If i test with '''netstat -lt''' there ist a line with | |||
<pre><nowiki> | |||
... | |||
tcp'''6''' 0 0 [::]:swat [::]:* LISTEN | |||
... | |||
</nowiki></pre> | |||
A: Swat seems to be bound to IPv6 instead of IPv4 | |||
Edit the following line with '''sudo nano /etc/inetd.conf''' | |||
<pre><nowiki> | |||
swat stream tcp nowait.400 root /usr/sbin/tcpd /usr/sbin/swat | |||
</nowiki></pre> | |||
into | |||
<pre><nowiki> | |||
swat stream tcp4 nowait.400 root /usr/sbin/tcpd /usr/sbin/swat | |||
</nowiki></pre> | |||
then restart inetd with '''sudo /etc/init.d/inetutils-inetd restart''' | |||
---- | ---- | ||
[[category: | [[category:CategoryNetworking]] | ||
[[category:UbuntuHelp]] | [[category:UbuntuHelp]] |
2009年11月17日 (二) 20:43的最新版本
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/Swat }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:Swat | UbuntuHelp:Swat | {{#if: | :}}Swat}}/af | • {{#if: UbuntuHelp:Swat|Afrikaans| [[::Swat/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Swat | UbuntuHelp:Swat | {{#if: | :}}Swat}}/ar | • {{#if: UbuntuHelp:Swat|العربية| [[::Swat/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Swat | UbuntuHelp:Swat | {{#if: | :}}Swat}}/az | • {{#if: UbuntuHelp:Swat|azərbaycanca| [[::Swat/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Swat | UbuntuHelp:Swat | {{#if: | :}}Swat}}/bcc | • {{#if: UbuntuHelp:Swat|جهلسری بلوچی| [[::Swat/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Swat | UbuntuHelp:Swat | {{#if: | :}}Swat}}/bg | • {{#if: UbuntuHelp:Swat|български| [[::Swat/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Swat | UbuntuHelp:Swat | {{#if: | :}}Swat}}/br | • {{#if: UbuntuHelp:Swat|brezhoneg| [[::Swat/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Swat | UbuntuHelp:Swat | {{#if: | :}}Swat}}/ca | • {{#if: UbuntuHelp:Swat|català| [[::Swat/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Swat | UbuntuHelp:Swat | {{#if: | :}}Swat}}/cs | • {{#if: UbuntuHelp:Swat|čeština| [[::Swat/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Swat | UbuntuHelp:Swat | {{#if: | :}}Swat}}/de | • {{#if: UbuntuHelp:Swat|Deutsch| [[::Swat/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Swat | UbuntuHelp:Swat | {{#if: | :}}Swat}}/el | • {{#if: UbuntuHelp:Swat|Ελληνικά| [[::Swat/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Swat | UbuntuHelp:Swat | {{#if: | :}}Swat}}/es | • {{#if: UbuntuHelp:Swat|español| [[::Swat/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Swat | UbuntuHelp:Swat | {{#if: | :}}Swat}}/fa | • {{#if: UbuntuHelp:Swat|فارسی| [[::Swat/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Swat | UbuntuHelp:Swat | {{#if: | :}}Swat}}/fi | • {{#if: UbuntuHelp:Swat|suomi| [[::Swat/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Swat | UbuntuHelp:Swat | {{#if: | :}}Swat}}/fr | • {{#if: UbuntuHelp:Swat|français| [[::Swat/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Swat | UbuntuHelp:Swat | {{#if: | :}}Swat}}/gu | • {{#if: UbuntuHelp:Swat|ગુજરાતી| [[::Swat/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Swat | UbuntuHelp:Swat | {{#if: | :}}Swat}}/he | • {{#if: UbuntuHelp:Swat|עברית| [[::Swat/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Swat | UbuntuHelp:Swat | {{#if: | :}}Swat}}/hu | • {{#if: UbuntuHelp:Swat|magyar| [[::Swat/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Swat | UbuntuHelp:Swat | {{#if: | :}}Swat}}/id | • {{#if: UbuntuHelp:Swat|Bahasa Indonesia| [[::Swat/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Swat | UbuntuHelp:Swat | {{#if: | :}}Swat}}/it | • {{#if: UbuntuHelp:Swat|italiano| [[::Swat/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Swat | UbuntuHelp:Swat | {{#if: | :}}Swat}}/ja | • {{#if: UbuntuHelp:Swat|日本語| [[::Swat/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Swat | UbuntuHelp:Swat | {{#if: | :}}Swat}}/ko | • {{#if: UbuntuHelp:Swat|한국어| [[::Swat/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Swat | UbuntuHelp:Swat | {{#if: | :}}Swat}}/ksh | • {{#if: UbuntuHelp:Swat|Ripoarisch| [[::Swat/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Swat | UbuntuHelp:Swat | {{#if: | :}}Swat}}/mr | • {{#if: UbuntuHelp:Swat|मराठी| [[::Swat/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Swat | UbuntuHelp:Swat | {{#if: | :}}Swat}}/ms | • {{#if: UbuntuHelp:Swat|Bahasa Melayu| [[::Swat/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Swat | UbuntuHelp:Swat | {{#if: | :}}Swat}}/nl | • {{#if: UbuntuHelp:Swat|Nederlands| [[::Swat/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Swat | UbuntuHelp:Swat | {{#if: | :}}Swat}}/no | • {{#if: UbuntuHelp:Swat|norsk| [[::Swat/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Swat | UbuntuHelp:Swat | {{#if: | :}}Swat}}/oc | • {{#if: UbuntuHelp:Swat|occitan| [[::Swat/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Swat | UbuntuHelp:Swat | {{#if: | :}}Swat}}/pl | • {{#if: UbuntuHelp:Swat|polski| [[::Swat/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Swat | UbuntuHelp:Swat | {{#if: | :}}Swat}}/pt | • {{#if: UbuntuHelp:Swat|português| [[::Swat/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Swat | UbuntuHelp:Swat | {{#if: | :}}Swat}}/ro | • {{#if: UbuntuHelp:Swat|română| [[::Swat/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Swat | UbuntuHelp:Swat | {{#if: | :}}Swat}}/ru | • {{#if: UbuntuHelp:Swat|русский| [[::Swat/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Swat | UbuntuHelp:Swat | {{#if: | :}}Swat}}/si | • {{#if: UbuntuHelp:Swat|සිංහල| [[::Swat/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Swat | UbuntuHelp:Swat | {{#if: | :}}Swat}}/sq | • {{#if: UbuntuHelp:Swat|shqip| [[::Swat/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Swat | UbuntuHelp:Swat | {{#if: | :}}Swat}}/sr | • {{#if: UbuntuHelp:Swat|српски / srpski| [[::Swat/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Swat | UbuntuHelp:Swat | {{#if: | :}}Swat}}/sv | • {{#if: UbuntuHelp:Swat|svenska| [[::Swat/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Swat | UbuntuHelp:Swat | {{#if: | :}}Swat}}/th | • {{#if: UbuntuHelp:Swat|ไทย| [[::Swat/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Swat | UbuntuHelp:Swat | {{#if: | :}}Swat}}/tr | • {{#if: UbuntuHelp:Swat|Türkçe| [[::Swat/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Swat | UbuntuHelp:Swat | {{#if: | :}}Swat}}/vi | • {{#if: UbuntuHelp:Swat|Tiếng Việt| [[::Swat/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Swat | UbuntuHelp:Swat | {{#if: | :}}Swat}}/yue | • {{#if: UbuntuHelp:Swat|粵語| [[::Swat/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Swat | UbuntuHelp:Swat | {{#if: | :}}Swat}}/zh | • {{#if: UbuntuHelp:Swat|中文| [[::Swat/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Swat | UbuntuHelp:Swat | {{#if: | :}}Swat}}/zh-hans | • {{#if: UbuntuHelp:Swat|中文(简体)| [[::Swat/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Swat | UbuntuHelp:Swat | {{#if: | :}}Swat}}/zh-hant | • {{#if: UbuntuHelp:Swat|中文(繁體)| [[::Swat/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:Swat|:Swat|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :Swat/zh | | {{#ifexist: Swat/zh | | {{#ifeq: {{#titleparts:Swat|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:Swat|1|-1|}} | zh | | }}
From the swat man page: swat allows a Samba administrator to configure the complex smb.conf file via a Web browser. In addition, a swat configuration page has help links to all the configurable options in the smb.conf file allowing an administrator to easily look up the effects of any change.
- Installing and running Samba is outside the scope of this document.
- How to actually use Swat is outside the scope of this document, but http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/SWAT.html#id2651818 is a good place to get started.
Installing Swat
sudo apt-get install swat xinetd
sudo nano /etc/xinetd.d/swat
- Insert the following text (borrowed from http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/SWAT.html#xinetd):
# default: off # description: SWAT is the Samba Web Admin Tool. Use swat \ # to configure your Samba server. To use SWAT, \ # connect to port 901 with your favorite web browser. service swat { port = 901 socket_type = stream wait = no # Use only_from if you want to restrict access # only_from = localhost user = root server = /usr/sbin/swat log_on_failure += USERID disable = no }
1.#4 Exit and Save
Running Swat
sudo /etc/init.d/xinetd restart
- Point your browser to http://localhost:901/
- Enter the username and password of a user with proper privileges
Questions
Q: my feisty system doesn't have /etc/xinetd.d/
, now what?
A: you will need to install a dependency beforehand: xinetd
sudo apt-get install xinetd sudo update-inetd --enable 'swat'
then create the /etc/xinetd.d/swat
as above,
and now sudo dpkg-reconfigure xinetd
to restart with the new configuration.
kudos to fabioleitao for the answer, http://ubuntuforums.org/showpost.php?p=980625&postcount=8
Q: The swat help links do not work. How do I tell swat where to find the man pages?
A: You don’t have to tell swat where they are you have to install them.
sudo apt-get install samba-doc
Q: When I open the web page I only see four boxes (Home, Status, View, Password) but none of these boxes give me the ability to configure Samba. What should I do? A: You do not have the necessary permissions. You will need to ensure you are a user of the administration group (‘admin’) and that the adm group has sufficient access rights to the Samba configuration file (‘smb.conf’). Note the user created during the installation is automatically a member of the adm group. To ensure the adm group has proper permissions over ‘smb.conf’ use ‘chmod’ and ‘chgrp’ tools to change the file access permissions and group permissions respectively:
sudo chmod g+w /etc/samba/smb.conf sudo chgrp adm /etc/samba/smb.conf
Another method is to grant all users—the whole world essentially—complete access to ‘smb.conf’. This is not recommended for obvious security reasons.
sudo chmod 777 /etc/samba/smb.conf
Now refresh your browser window and you should see additional boxes for Globals, Shares, Printers and Wizard. Q: On my 6.06 LTS server clients don't see the swat page. It is just a blank page. What now? A: Edit the /etc/samba/smb.conf file so that the file contains a line for allowed hosts like:
sudo vi /etc/samba/smb.conf
or, if you are not that comfortable with vi:
sudo nano /etc/samba/smb.conf
Add or change the following line:
[global] ...... ....... hosts allow = 192.168.1.0/255.255.255.0 [printers]
Of course this has to match your own network settings. After this you have to restart the samba subsystem.
sudo /etc/init.d/samba restart
Q: On my 9.04 Server i can't access swat. If i test with netstat -lt there ist a line with
... tcp'''6''' 0 0 [::]:swat [::]:* LISTEN ...
A: Swat seems to be bound to IPv6 instead of IPv4 Edit the following line with sudo nano /etc/inetd.conf
swat stream tcp nowait.400 root /usr/sbin/tcpd /usr/sbin/swat
into
swat stream tcp4 nowait.400 root /usr/sbin/tcpd /usr/sbin/swat
then restart inetd with sudo /etc/init.d/inetutils-inetd restart