View previous topic :: View next topic |
Author |
Message |
berhr n00b
Joined: 15 Sep 2002 Posts: 30 Location: Wisconsin, USA
|
Posted: Wed Sep 18, 2002 3:34 am Post subject: Cannot connect to SWAT |
|
|
I am currently trying to set up samba on my Gentoo system. I have samba installed and added to the default runlevel. My current smb.conf (based off of the smb.conf.example file) checks out with testparm.
My problem lies with SWAT. I emerged xinetd, added it to the default runlevel, and edited the /etc/xinetd.d/swat file so disabled is set to no. I also successfully added the root user and password to my smbpasswd file.
However, if I attempt to connect to "http://localhost:901" in my browser, nothing happens. Mozilla shows a blank screen, and the status bar claims it's trying to contact www.localhost.com. Oddly enough, "http://localhost:631" works correctly for the CUPS web-based interface. (Although CUPS does not use xinetd to handle requests, so that might not mean anything)
I used netstat and nmap to verify that xinetd is listening on port 901 - which it is. I also tried "telnet localhost 901" and got the following output:
Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
Connection closed by foreign host.
At this point, I am not sure what to do. My suspicion is that it might be a hosts.allow problem, since I have not set that file up. However, I thought I'd post here, just in case anybody with more experience than I have can positively identify the problem. |
|
Back to top |
|
|
Mpemba Effect Apprentice
Joined: 18 Sep 2002 Posts: 156
|
Posted: Wed Sep 18, 2002 11:22 am Post subject: |
|
|
You should have already, but make sure you have the line
Code: |
swat 901/tcp # Samba configuration tool
|
in your /etc/services
can you post up a copy of your xinetd? |
|
Back to top |
|
|
berhr n00b
Joined: 15 Sep 2002 Posts: 30 Location: Wisconsin, USA
|
Posted: Wed Sep 18, 2002 3:27 pm Post subject: |
|
|
Thanks for your response, Mpemba Effect. I double-checked /etc/services, and SWAT is in there at port 901. (I already had checked that, but I forgot to mention that in my original post).
Here is my /etc/xinetd.conf file:
defaults
{
only_from = localhost
instances = 60
log_type = SYSLOG authpriv info
log_on_success = HOST PID
log_on_failure = HOST
cps = 25 30
}
includedir /etc/xinetd.d
In the /etc/xinetd.d/ directory, I have a file called swat:
service swat
{
port = 901
socket_type = stream
wait = no
only_from = localhost
user = root
server = /usr/sbin/swat
log_on_failure += USERID
disable = no
}
Hopefully, this information helps.
I also tried setting up hosts.allow after my original post, but that had no effect. I created a hosts.allow file, and added the line
which didn't work. I then changed the line to
and that didn't work. Perhaps somebody can tell me if I misconfigured hosts.allow, or if that is not the source of problem. |
|
Back to top |
|
|
Mpemba Effect Apprentice
Joined: 18 Sep 2002 Posts: 156
|
Posted: Wed Sep 18, 2002 10:30 pm Post subject: |
|
|
Your configs look ok. I don't think it is your hosts.allow ... although I never tried samba/swat on linux, I use it on Freebsd, AFAIK you don't need to add anything into hosts.allow.
One thing it could be is the SWAT:Linux PAM authentication. You need to create a samba file in /etc/pam.d ... apparently ... here have a read http://samba.linuxbe.org/en/samba/learn/swat.html |
|
Back to top |
|
|
berhr n00b
Joined: 15 Sep 2002 Posts: 30 Location: Wisconsin, USA
|
Posted: Thu Sep 19, 2002 3:36 pm Post subject: |
|
|
Once again, thanks for the help, Mpemba Effect. I checked into the PAM stuff you mentioned and linked to. Apparently, Gentoo sets up a samba file in /ete/pam.d/. The file is not identical to the suggested file in the linked site, but I'll trust Gentoo's default here (I have not found any other posts about PAM/Samba problems in Gentoo).
So, I'm still stuck. I've tried some Google searches, but haven't found any answers to this problem that way. So, anyone got any new ideas? |
|
Back to top |
|
|
hoppy n00b
Joined: 14 Sep 2002 Posts: 44
|
Posted: Fri Sep 20, 2002 1:03 am Post subject: Re: Cannot connect to SWAT |
|
|
berhr wrote: | I am currently trying to set up samba on my Gentoo system. I have samba installed and added to the default runlevel. My current smb.conf (based off of the smb.conf.example file) checks out with testparm.
My problem lies with SWAT. I emerged xinetd, added it to the default runlevel, and edited the /etc/xinetd.d/swat file so disabled is set to no. I also successfully added the root user and password to my smbpasswd file.
However, if I attempt to connect to "http://localhost:901" in my browser, nothing happens. Mozilla shows a blank screen, and the status bar claims it's trying to contact www.localhost.com. Oddly enough, "http://localhost:631" works correctly for the CUPS web-based interface. (Although CUPS does not use xinetd to handle requests, so that might not mean anything)
I used netstat and nmap to verify that xinetd is listening on port 901 - which it is. I also tried "telnet localhost 901" and got the following output:
Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
Connection closed by foreign host.
At this point, I am not sure what to do. My suspicion is that it might be a hosts.allow problem, since I have not set that file up. However, I thought I'd post here, just in case anybody with more experience than I have can positively identify the problem. |
this looks to me to be more of a name resolution issue than anything else. your host doesnt seem to realise who it is. can you post your /etc/hosts and /etc/hostname files? I would add your ip address (from ifconfig) to /etc/xinet.d/swat
Code: | only_from = localhost 192.168.100.20 |
and then connect in via telnet to that ip address (and 127.0.0.1). see how that goes. |
|
Back to top |
|
|
thetamind n00b
Joined: 20 Sep 2002 Posts: 3 Location: Manitoba, Canada
|
Posted: Fri Sep 20, 2002 1:53 am Post subject: Swat |
|
|
I could never get lynx to authorize with swat. After reading the swat man page, I found an option to disable authorization.
Add this to /etc/xinetd.d/swat.
WARNING: This allows anyone to use swat without logging on. Anyone could share your entire filesystem with write permissions and then do whatever they please.
Maybe only enable this for initial setup and keep it disabled when not in use.
Also try webmin, which has a swat section. I still had to do this trick to use swat in webmin though. |
|
Back to top |
|
|
scottro Tux's lil' helper
Joined: 13 Apr 2002 Posts: 141 Location: New York City
|
Posted: Fri Sep 20, 2002 2:40 am Post subject: |
|
|
What about just not using swat? I remember when I first tried Samba--looked at the O'Reilly online book and Samba for Dummies (hey, water seeks it's own level, ok?) They both mentioned swat and I didn't know enough at that point to know about allowing a firewall port or something--shucks, I don't even remember what the issue was. At any rate, I gave up on it and thought I'd be far cooler to just modify the text files. While doing it I thought, wow, this is pretty easy.
I know that doesn't solve your problem, but it's a thought anyway--I have a page on samba that I put up primarily as a reminder to myself--mostly RH and Slack oriented, a few things on Gentoo (the main thing with Gentoo was printing,) at the bottom. It's at
http://home.nyc.rr.com/computertaijutsu/samba.html
Hope that helps, even if I'm avoiding answering your question (because I don't know the answer)
Scott |
|
Back to top |
|
|
berhr n00b
Joined: 15 Sep 2002 Posts: 30 Location: Wisconsin, USA
|
Posted: Fri Sep 20, 2002 3:20 am Post subject: Thanks |
|
|
Hi,
Thank you everyone for your thoughts on how to fix this problem. A big thank you to hoppy - your suggestion to add my IP address to /etc/xinetd.d/swat was the solution to this problem. SWAT works just fine now.
Also thanks to thetamind and scottro for your comments. I haven't tried to use lynx with SWAT, but I'll keep the advice in mind; and it would be nice to learn the actual smb.conf file, so thanks for the tips on reading material (as if school doesn't keep me busy enough with reading ).
Just a recap for anyone else having this problem: add your IP address to the only_from line in the /etc/xinetd.d/swat file, and SWAT will work (assuming you've set everything else up correctly). |
|
Back to top |
|
|
2CUrious n00b
Joined: 17 Jun 2002 Posts: 9
|
Posted: Wed Dec 11, 2002 5:31 pm Post subject: Samba/Swat + LDAP |
|
|
There is still a problem when you use LDAP.
I use LDAP for linux authentication. After setting this up I also started using Samba. Configured everything (/etc/xinetd.d/swat, /etc/samba/smb.conf).
and started the samba processes.
But It was impossible to 'map' my Samba shared and to connect to Swat (Bad authorization).
It also seemed impossible to modify or create users. All the errors were about ldap.
First I tried to configure OpenLDAP and Samba so LDAP would work for Samba also. Unfortunately I did not succeed
(needs more investigation...). Because I needed Samba to work urgently I changed the USE variable ldap entry in the /etc/make.conf to -ldap
Then did a rebuild of Samba (# emerge samba).
After that everything works okay (adding users, using swat and connecting shares). ..but case not closed yet. Now I want Samba to use LDAP |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|