參考了:http://linux.chinaunix.net/techdoc/net/2007/03/14/952274.shtml,對其進行了部分修改完善。html
依次執行linux
一、sudo apt-get samba samba-common smbfs smbclient swatubuntu
二、apt-get install xinetd swat依賴xineed才能正常工做vim
三、修改xinetd.conf (路徑位置爲:root@ubuntu:/etc# vim xinetd.conf)
添加:swat stream tcp nowait.400 root /usr/sbin/tcpd \ /usr/sbin/swat c#
注意放在default 括號以外socket
---------------------------------------------------tcp
root@ubuntu:/etc# cat xinetd.conf .net
# Simple configuration file for xinetdunix
#server
# Some defaults, and include /etc/xinetd.d/
defaults
{
# Please note that you need a log_type line to be able to use log_on_success
# and log_on_failure. The default is the following :
# log_type = SYSLOG daemon info
}
includedir /etc/xinetd.d
swat stream tcp nowait.400 root /usr/sbin/tcpd \ /usr/sbin/swat
-------------------------------------------------------
四、新建swat文件 vi /etc/xinetd.d/swat
內容以下:
代碼:
# description: SAMBA SWAT
service swat
{
disable = no
socket_type = stream
protocol = tcp
#should use a more limited user here
user = root
wait = no
server = /usr/sbin/swat
}
五、sudo dpkg-reconfigure xinetd
六、查看swat是否運行
運行命令: netstat -lt
若是出現tcp 0 0 *:swat *:* LISTEN,表示swat配置運行成功,正在監聽
--------------------------
root@ubuntu:/etc# netstat -lt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 *:swat *:* LISTEN
---------------------------------
這裏使用的是IP訪問
大功告成!