Click to See Complete Forum and Search --> : Cant get SWAT to work!
djp4059
02-02-2003, 06:43 AM
I've looked through some posts, but I dont see anything related to my problem. I'm using Red Hat 7.1 that came with a book called "Linux Admistration A Guide for beginers", well I have been following all the instructions, but it comes to a point where it says to edit the /etc/inetd.conf file or the /etc/xinetd.d/swat file, neither one of them is there. What can I do?
Another question I have is the next step in the book after the editing one above is to send a kill command, the thing I dont get, is that he has it running from a /scr file example(root@ford src) #
but doesnt say which /scr file or the reason for it, any ideas?
I downloaded the latest samba release and it installed, I started it wit the /etc/rc.d/init.d/smb start command and 2 okays come up,
also did the /usr/local/samba/bin/smbd -D & nmbd -D commands,they didnt say anything, but I didnt get a bash or error come up. So I'm pretty sure samba is installed correctly.
endoalpha
02-02-2003, 06:47 AM
do you have samba and swat installed?
djp4059
02-02-2003, 06:54 AM
The book didnt say anything about installing Swat, it just said to set it up. I set the permissions with the chmod -R 755 /usr/local/samba/swat command, and editted the etc/services file with swat 901/tcp.
It seems that all the files are there.
endoalpha
02-02-2003, 07:17 AM
You need to know if samba and swat are installed. I don't think redhat installs anything like that into /usr/local/ . Both samba and swat should be available as RPM's on your install disks.
djp4059
02-02-2003, 07:20 AM
Swat comes with samba, and I downloaded the latest version and installed it, and it all went well. I think the problem may be that the latest version doesnt work with 7.1, I might have to get an older version.
cowanrl
02-02-2003, 11:44 AM
You should be able to get the latest version of Samba and SWAT running on RH 7.1.
If the command:
chmod -R 755 /usr/local/samba/swat
executed without error, then SWAT is probably installed. You just need to create the /etc/xinetd.d/swat file. Here's what it should look like:
# 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
{
disable = no
port = 901
socket_type = stream
wait = no
only_from = 127.0.0.1
user = root
server = /usr/sbin/swat
log_on_failure += USERID
}
You'll probably need to change the line:
server = /usr/sbin/swat
to:
server = /usr/local/samba/bin/swat
The difference in the 2 lines is that the swat executable is installed in different locations if you use the Red Hat distribution(what I'm using) or download Samba from samba.org(what it looks like you did).
Once you get the /etc/xinetd.d/swat file created, then just enter:
service xinetd restart
at the command line to restart the xinetd service. You should then be able to access SWAT from your browser at:
http://localhost:901
If that doesn't work, try:
http://127.0.0.1:901
Log in with user root and the root password.
slapNUT
02-02-2003, 05:05 PM
Execellent reply cowanrl.
I will bookmark this thread and link it to all the swat questions in the future!
I gave a :cool:5-Star:cool:
djp4059
02-02-2003, 05:22 PM
Still not working, I still get "cannot connect to port 901", how about the kill commands I mentioned above, any ideas on that?
cowanrl
02-02-2003, 05:57 PM
What is the exact kill command your are supposed to execute?
If it is to be done right after editing the SWAT file, then maybe it was to stop the inetd or xinetd service. It would have to be stopped and restarted for SWAT to start up.
Since SWAT runs under xinetd, it's hard to see if it's running. One way is to see if port 901 is open. Try to execute this as root:
nmap -sT localhost
It should give you a list of ports that are accessible. If you don't see TCP port 901 then you won't be able to access SWAT.
It's also possible you could have a firewall running that will block SWAT. A default install of Red Hat will block all Samba and SWAT access.
To shut down the firewall to see if it is the problems try these commands as root:
service iptables stop
(this is a Red Hat specific command)
or
iptables -F
Then try to access SWAT again. If it now works, you'll need to modify your firewall settings. That's a whole 'nother subject for a whole 'nother post.
javmarcan
02-02-2003, 06:18 PM
first see if you have the inetd.conf
$ ls /etc/inetd.conf
now go to /etc/services and see if you have these two lines
swat 901/tcp # samba web configuration tool
and
netbios-ns 137/tcp #NETBIOS Name Service
go to /etc/inetd.conf and uncomment
netbios-ssn stream tcp nowait root /usr/sbin/smbd smbd
netbios-ns dgram udp wait root /usr/sbin/nmbd nmbd
and
swat stream tcp nowait.400 root /usr/sbin/swat swat
now restart the inetd with this command
$ killall -HUP inetd
the kill command that you said is this its send a hungup call to the daemon
now try
djp4059
02-02-2003, 06:47 PM
I'll try that when I switch back and put the Red Hat hard drive in.
I put another hard drive in and installed Mandrake 9.0, again there are some probs.
1.) the services files has the "swat 901/tcp line in it (good)
2.)etc/xinetd file doesnt have a swat file (no good) but I can fix
that. But look at 3.).
3.)did a file search for the swat executable, no where to be found.
Cant make a the swat file if I cant point it to the execuable.
Do I have to reinstall samba ? And if I do, do I have to uninstall
samba first, and how do I do that if I have to?
javmarcan
02-02-2003, 07:04 PM
ok first you dont really "need" swat.
swat (and acronym of Samba Web Administration Tool) is just to make things easier and to configure samba with a fairly nice web enviroment but you can configure by changing the smb.conf file by hand.
change what you need
# Samba config file created using SWAT
# from localhost (127.0.0.1)
# Date: 2003/01/28 02:49:34
# Global parameters
[global]
workgroup = NET
netbios name = my_box
server string = Shares
encrypt passwords = Yes
update encrypted = Yes
log file = /var/log/samba.%m
max log size = 50
dns proxy = No
hosts allow = 192.168.1.0/255.255.255.0
[Music]
comment = Mp3
path = usr/local/Mp3
write list = tux
read only = No
[Documentos]
comment = shares files
path = /home/samba
writable = true
guest ok = Yes
djp4059
02-02-2003, 07:10 PM
I did a search of some posts in this forum, and found out a possible solution. It said that "Installation Disk 2" had the rpm's for samba and swat, so I looked. There are 3 samba related rpm's, (Samba-server, Samba-Swat, and Samba-Winbind all with the same version number) Do you think that the distro only loaded one of them? Of course which one, and should I load one of the other ones or all three? I am pretty sure samba is loaded on the machine, all the files are there and it during the install it asked which service should be installed at start up, and samba or smb was checked.
javmarcan
02-02-2003, 07:57 PM
try all of them and rpm -U to unistall if something is in your system now
maybe you installed samba but now swat
as I told you there are differents things.
samba is the smbfs daemon while swat is just a tool to configure it
djp4059
02-02-2003, 09:47 PM
Thanks for the help, I got it to work, now on to the password problem.
djp4059
02-03-2003, 12:04 AM
Everything is working fine now. Thanks for all the help.
javmarcan
02-03-2003, 05:14 PM
to mount a shared directory on the linux box you have to just tipe this on the command line
$ mount -t smbfs -o username=a_user_on_the_win_box, password=passwd_of the_user //winbox/dir /mnt/dir
and to access from the win box you have to add a samba user that have the same username of a user in your system
i.e:
smbpasswd -a user_in_your_sys
for changing permissions you can put
gues= ok in the smb.conf and give write permissions to everyone in the shared folder
hope it works