LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-21-2002, 01:03 AM   #1
rcj2
LQ Newbie
 
Registered: Dec 2002
Posts: 6

Rep: Reputation: 0
Samba problem with accessing localhost:901


hello

What would be the cause of getting the error " The connection was refused when attempting to connect to 127.0.0.1:901 " When I try to go to http://localhost:901 I get a failed search on the internet for LOCALHOST. I am trying to connect from the box that has Samba installed.

I am using the xinetd.d and I have the file /etc/xinetd.d./swat, it's not disabeld, and I am running it as root. I have also restarted the daemon and rebooted. No
luck. Samba is also installed on this same box. I am not trying to access it remotely. .

Please help.
 
Old 12-21-2002, 10:28 AM   #2
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
what distro are you runnning?
 
Old 12-21-2002, 12:22 PM   #3
wdingus
Member
 
Registered: Aug 2001
Location: Kingsport, TN
Distribution: RHEL & FC
Posts: 267

Rep: Reputation: 30
Localhost is a more or less generic term for the loopback network interface on your own local machine. The IP address 127.0.0.1 is the loopback interface and is known by the hostname localhost. Check to be sure your machine hasn't gotten this screwed up. In a shell do "ping localhost" and be sure it successfully pings and resolves the name localhost to 127.0.0.1

Having said that, you won't be able to surf from another machine to the one you're setting up swat/samba on via the localhost name. Localhost always points to the local PC you're typing at. If you're coming from another box to this one, do http://ip_address:901/ where ip_address = the IP Address of the box running Samba, SWAT...

Try it by hand: "telnet localhost 901" to see if you get a connection or a connection refused. If it's refused on the telnet then your browser is telling you the truth and SWAT isn't accepting requests on that port, or at all...

Is SWAT defined to run on port 901?
# grep -i swat /etc/services
swat 901/tcp # Samba Web Administration Tool

Here's my xinetd.d entry for swat:

# 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
}

Looks like it's hard-coded for port 901 here so /etc/services probably doesn't matter. Notice also that for security reasons it's set to only accept requests from the localhost/loopback/127.0.0.1 interface.
 
Old 12-21-2002, 12:41 PM   #4
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
Some of the distros, Mandrake for one have a selection at install that pertains to security level

this can really get things wacked, however the place start looking might be /etc/hosts.allow and /etc/hosts.deny
 
Old 12-21-2002, 08:27 PM   #5
rcj2
LQ Newbie
 
Registered: Dec 2002
Posts: 6

Original Poster
Rep: Reputation: 0
I am running Redhat 7.2.
Let me know what you guys think.

root@localhost xinetd.d]# cat swat
# 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
}
******************************
[root@localhost root]# netstat -antp
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:1024 0.0.0.0:* LISTEN 782/rpc.statd
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 754/portmap
tcp 0 0 0.0.0.0:6000 0.0.0.0:* LISTEN 1170/X
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 950/sshd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1023/sendmail: acce
tcp 0 0 127.0.0.1:1146 0.0.0.0:* LISTEN 3186/xinetd
[root@localhost root]#
******
[root@localhost etc]# cat hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
 
Old 12-21-2002, 08:46 PM   #6
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
try a different browser

you should be getting access denied or a password prompt.

maybe there's something wrong witc /etc/resolv.conf

Last edited by DavidPhillips; 12-21-2002 at 09:07 PM.
 
Old 12-21-2002, 08:55 PM   #7
rcj2
LQ Newbie
 
Registered: Dec 2002
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by DavidPhillips
try a different browser

you should be getting access denied or a password prompt.

maybe there's aomething wrong witc /etc/resolv.conf
I am getting the error message "The connection was refused when attempting to connect to 127.0.0.1:901 "
 
Old 12-21-2002, 08:59 PM   #8
rcj2
LQ Newbie
 
Registered: Dec 2002
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by DavidPhillips
try a different browser

you should be getting access denied or a password prompt.

maybe there's aomething wrong witc /etc/resolv.conf

[root@localhost etc]# cat resolv.conf
domain
nameserver 151.164.14.201
nameserver 151.164.1.8
search
[root@localhost etc]# cat hosts.allow
#
# hosts.allow This file describes the names of the hosts which are
# allowed to use the local INET services, as decided
# by the '/usr/sbin/tcpd' server.
#

[root@localhost etc]# cat hosts.deny
#
# hosts.deny This file describes the names of the hosts which are
# *not* allowed to use the local INET services, as decided
# by the '/usr/sbin/tcpd' server.
#
# The portmap line is redundant, but it is left to remind you that
# the new secure portmap uses hosts.deny and hosts.allow. In particular
# you should know that NFS uses portmap!

[root@localhost etc]# cat hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
[root@localhost etc]#
 
Old 12-24-2002, 07:17 AM   #9
rcj2
LQ Newbie
 
Registered: Dec 2002
Posts: 6

Original Poster
Rep: Reputation: 0
Question

Does anyone have any other ideas on this?

I'm still stuck.

Thanks for your time.
 
Old 12-24-2002, 09:57 AM   #10
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
let's verify /etc/services
Code:
swat           901/tcp
check out swat and make sure it's where it's supposed to be
Code:
root@slacker:~# ldd /usr/sbin/swat
        libdl.so.2 => /lib/libdl.so.2 (0x40024000)
        libnsl.so.1 => /lib/libnsl.so.1 (0x40028000)
        libcrypt.so.1 => /lib/libcrypt.so.1 (0x4003d000)
        libssl.so.0 => /usr/lib/libssl.so.0 (0x4006a000)
        libcrypto.so.0 => /usr/lib/libcrypto.so.0 (0x40118000)
        libpopt.so.0 => /usr/lib/libpopt.so.0 (0x401cf000)
        libc.so.6 => /lib/libc.so.6 (0x401d5000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)


root@slacker:~# file /usr/sbin/swat
/usr/sbin/swat: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), stripped



 ls -l /usr/sbin/swat
-rwxr-xr-x    1 root     root      1025883 Nov 20 11:24 /usr/sbin/swat

and check /var/log/messages

Code:
cat /var/log/messages | grep swat

Last edited by DavidPhillips; 12-24-2002 at 10:00 AM.
 
Old 12-24-2002, 12:51 PM   #11
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
another thing you might try isrun

setup


choose system services
make sure it has swat enabled

maybe if it is disable it save and quit, then go back enable it again

or run

chkconfig swat on
 
Old 02-03-2003, 12:29 PM   #12
lsterman
LQ Newbie
 
Registered: Feb 2003
Distribution: redhat 8.0
Posts: 4

Rep: Reputation: 0
This is evidently a very common problem. In searching for a fix, I have seen hundreds of similar messages describing the inability to use swat because of "connection refused." This also seems to apply to other services accessed through the browser. I have done all of the things suggested on this thread and more, yet nothing seems to work. When using my browser, I am unable to connect to localhost. I'm sure that I'm doing something wrong that is simple or dumb, but I haven't yet figured out what it is.

I have installed Samba and it seems to be working properly. I'm able to access my shares and browse linux computer through a Windows XP machine. I am using the default installation of Redhat 8 as modified to use swat.

Any ideas would be deeply appreciated. I'm just about out of things to try.
 
Old 02-03-2003, 01:22 PM   #13
RonS
LQ Newbie
 
Registered: Jan 2003
Location: WI USA
Posts: 23

Rep: Reputation: 15
'chkconfig swat on' worked for me when I had this problem.

lsterman: Ican run SWAT, but cn't browse Linux box from XP Pro. You can browse, but can't run SWAT. Aren't computers grand!
 
Old 02-03-2003, 02:49 PM   #14
TheTrexx
LQ Newbie
 
Registered: Dec 2002
Posts: 10

Rep: Reputation: 0
Look in /etc/xinetd.d/swat, and look for the line "only_from=127.0.0.1" Erase this line. That's what I did, and I can access SWAT from my Linux PC, and also my other Windows PCs. This is the only solution I can think of.
 
Old 02-03-2003, 04:09 PM   #15
mawarsha
Member
 
Registered: Feb 2003
Distribution: RedHat 8.0, Mandrake 9.1
Posts: 54

Rep: Reputation: 15
I was having the same problem but I ended up reformatting my linux box and after that SWAT worked. If you are behind a router/firewall I would just try typing in 192.168.0.X:901 - that may work.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with Samba: http://localhost:901 doesn't work lagu2653 Linux - Networking 5 06-29-2005 03:13 PM
Samba - Swat: Cannot Connect to Localhost:901 Sloppyunderfoot Linux - Networking 3 02-10-2005 12:26 PM
SAMBA & SWAT - Connection refused when attempting to connect Localhost:901 ScooterB Linux - Networking 3 12-24-2003 04:15 PM
Errors on accessing Swat SAMBA http://localhost:901 @ Mandrake 9.0. Zepiroth Linux - Networking 2 06-03-2003 09:51 PM
localhost:901,it says:it cannot be found. whepin Linux - Networking 1 12-31-2001 08:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration