| Author |
Samba problem with 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.
Please help. | |
| Boulware5 2002-12-20, 9:20 pm |
| If you are using the inetd superserver, make sure the swat line in inetd.conf is not commented out and is indeed there. Be sure port 901 is present in /etc/services. | |
|
| quote: Originally posted by Boulware5
If you are using the inetd superserver, make sure the swat line in inetd.conf is not commented out and is indeed there. Be sure port 901 is present in /etc/services.
I am using the xinetd.d. | |
| Boulware5 2002-12-20, 11:40 pm |
| quote: Originally posted by Rcj2
I am using the xinetd.d.
See if you have a file called /etc/xinetd.d./swat. Make sure it's not disabled. Also be sure you are running it as root. Restart xinetd if you make changes. | |
|
| quote: Originally posted by Boulware5
See if you have a file called /etc/xinetd.d./swat. Make sure it's not disabled. Also be sure you are running it as root. Restart xinetd if you make changes.
I have checked all those. 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 htis same box. I am not trying to access it remotely.
It is strange!! | |
| Mr. Linux Guy 2002-12-21, 6:59 am |
| $ grep smb /var/log/messages | less | |
|
| quote: Originally posted by Mr. Linux Guy
$ grep smb /var/log/messages | less
I did this and the screen output was blank. | |
|
| Here is some more info:
[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 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
******************************
*********** | |
| Mr. Linux Guy 2002-12-21, 3:23 pm |
| Might want to try grepping with the re 'samba' as well. Generally you look in /var/log/messages and /var/log/secure to see if any services were being accessed and to see what sort of error messages you get if the try was not successful. What daemons do you have running? You need to have smbd and nmbd to use the service. You need the samba server (not the client) installed as well as swat. Next, you need to have your xinetd file set up to allow the service. Next, you need to make sure that the default firewall rules allow you to connect to the port. Your xinetd looks ok right now, so let's try to rule each of the possible problems out one by one. Do a ps aux and grep the daemons to make sure that they are running first. | |
|
| Mr Linux Guy,
first off, Thanks a bunch.
I grepped for "samba" and got nothing in var/log/messages and also in var/log/secure and got the following:
[root@localhost log]# cat secure
Dec 20 12:24:21 localhost sshd[1007]: Server listening on 0.0.0.0 port 22.
Dec 20 12:25:18 localhost xinetd[1040]: START: sgi_fam pid=1451 from=0.0.0.0
Dec 20 12:25:39 localhost xinetd[1040]: START: sgi_fam pid=1496 from=0.0.0.0
Dec 20 12:46:34 localhost sshd[1007]: Received signal 15; terminating.
Dec 20 12:48:36 localhost sshd[949]: Server listening on 0.0.0.0 port 22.
Dec 20 13:10:54 localhost sshd[949]: Received signal 15; terminating.
Dec 20 13:12:38 localhost sshd[950]: Server listening on 0.0.0.0 port 22.
Dec 20 13:13:30 localhost xinetd[983]: START: sgi_fam pid=1376 from=0.0.0.0
*********
root@localhost log]# 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
tcp 1 0 192.168.0.112:1239 198.104.135.161:80 CLOSE_WAIT 3851/mozilla-bin
*****************************
As far as the daemons I have running, how would I go about finding out which are running? I'm sorry about all the questions, If you couldn't tell I'm new to all this. I tried ps aux and grepping for each daemon (smbd and nmbd). Hopefully I did it right. | |
|
| Here is the rest of the output
[root@localhost root]# ps aux | grep daemons
root 3901 0.0 0.6 1700 592 pts/0 S 20:41 0:00 grep daemons
[root@localhost root]# ps aux | grep smbd
root 3903 0.0 0.6 1700 592 pts/0 S 20:42 0:00 grep smbd
[root@localhost root]# ps aux | grep nmbd
root 3905 0.0 0.6 1700 592 pts/0 S 20:42 0:00 grep nmbd
[root@localhost root]# ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.0 1384 76 ? S Dec20 0:04 init
root 2 0.0 0.0 0 0 ? SW Dec20 0:00 [keventd]
root 3 0.0 0.0 0 0 ? SW Dec20 0:00 [kapm-idled]
root 4 0.0 0.0 0 0 ? SWN Dec20 0:00 [ksoftirqd_CPU0]
root 5 0.0 0.0 0 0 ? SW Dec20 0:01 [kswapd]
root 6 0.0 0.0 0 0 ? SW Dec20 0:00 [kreclaimd]
root 7 0.0 0.0 0 0 ? SW Dec20 0:00 [bdflush]
root 8 0.0 0.0 0 0 ? SW Dec20 0:00 [kupdated]
root 9 0.0 0.0 0 0 ? SW< Dec20 0:00 [mdrecoveryd]
root 13 0.0 0.0 0 0 ? SW Dec20 0:00 [kjournald]
root 88 0.0 0.0 0 0 ? SW Dec20 0:00 [khubd]
root 183 0.0 0.0 0 0 ? SW Dec20 0:00 [kjournald]
root 184 0.0 0.0 0 0 ? SW Dec20 0:00 [kjournald]
root 185 0.0 0.0 0 0 ? SW Dec20 0:00 [kjournald]
root 186 0.0 0.0 0 0 ? SW Dec20 0:00 [kjournald]
root 646 0.0 0.0 2060 4 ? S Dec20 0:00 /sbin/dhcpcd -n -root 729 0.0 0.1 1444 160 ? S Dec20 0:00 syslogd -m 0
root 734 0.0 0.4 2064 424 ? S Dec20 0:00 klogd -2
rpc 754 0.0 0.0 1532 4 ? S Dec20 0:00 portmap
rpcuser 782 0.0 0.0 1580 4 ? S Dec20 0:00 rpc.statdroot 894 0.0 0.0 1368 4 ? S Dec20 0:00 /usr/sbin/apmd -proot 950 0.0 0.2 2652 260 ? S Dec20 0:01 /usr/sbin/sshd
root 1023 0.0 0.9 5276 864 ? S Dec20 0:00 sendmail: acceptiroot 1042 0.0 0.0 1412 60 ? S Dec20 0:00 gpm -t ps/2 -m /d
root 1060 0.0 0.1 1568 116 ? S Dec20 0:00 crond
xfs 1112 0.0 3.7 5528 3512 ? S Dec20 0:13 xfs -droppriv -da
daemon 1148 0.0 0.0 1416 48 ? S Dec20 0:00 /usr/sbin/atd
root 1155 0.0 0.0 1356 0 tty1 SW Dec20 0:00 /sbin/mingetty tt
root 1156 0.0 0.0 1356 0 tty2 SW Dec20 0:00 /sbin/mingetty tt
root 1157 0.0 0.0 1356 0 tty3 SW Dec20 0:00 /sbin/mingetty tt
root 1158 0.0 0.0 1356 0 tty4 SW Dec20 0:00 /sbin/mingetty tt
root 1159 0.0 0.0 1356 0 tty5 SW Dec20 0:00 /sbin/mingetty tt
root 1162 0.0 0.0 1356 0 tty6 SW Dec20 0:00 /sbin/mingetty tt
root 1163 0.0 0.9 6176 920 ? S Dec20 0:00 /usr/bin/gdm -nod
root 1169 0.0 1.0 6688 1020 ? S Dec20 0:00 /usr/bin/gdm -nod
root 1170 0.2 23.3 30832 22080 ? R Dec20 4:57 /etc/X11/X :0 -au
root 1179 0.0 2.6 7360 2464 ? S Dec20 0:02 /usr/bin/gnome-se
root 1307 0.0 1.3 6148 1240 ? S Dec20 0:01 gnome-smproxy --s
root 1321 0.0 3.2 5712 3092 ? S Dec20 0:09 sawfish --sm-clie
root 1343 0.0 6.6 18144 6252 ? S Dec20 0:08 nautilus --sm-cli
root 1345 0.0 5.5 9580 5236 ? S Dec20 0:21 panel --sm-client
root 1347 0.0 1.9 7120 1844 ? S Dec20 0:42 magicdev --sm-cli
root 1349 0.0 0.8 3176 816 ? S Dec20 0:00 gnome-name-servic
root 1355 0.0 1.3 3760 1284 ? S Dec20 0:01 oafd --ac-activat
root 1362 0.0 1.4 3364 1392 ? S Dec20 0:00 gconfd-1 --oaf-ac
root 1366 0.0 4.0 7992 3868 ? S Dec20 0:07 tasklist_applet -
root 1368 0.0 3.6 7732 3448 ? S Dec20 0:04 deskguide_applet
root 1377 0.0 6.6 18144 6252 ? S Dec20 0:00 nautilus --sm-cli
root 1379 0.0 6.6 18144 6252 ? S Dec20 0:00 nautilus --sm-cli
root 1380 0.0 6.6 18144 6252 ? S Dec20 0:00 nautilus --sm-cli
root 3186 0.0 1.0 2280 964 ? S 09:42 0:00 xinetd -stayaliveroot 3771 0.0 4.7 8452 4492 ? R 19:24 0:04 gnome-terminal --
root 3774 0.0 0.5 1420 560 ? S 19:24 0:00 gnome-pty-helper
root 3775 0.0 1.4 2504 1360 pts/0 S 19:24 0:00 bash
root 3851 12.2 29.2 39668 27696 ? S 20:13 3:22 /usr/lib/mozilla/
root 3856 0.0 29.2 39668 27696 ? S 20:13 0:00 /usr/lib/mozilla/
root 3857 0.0 29.2 39668 27696 ? S 20:13 0:00 /usr/lib/mozilla/
root 3858 0.0 29.2 39668 27696 ? S 20:13 0:00 /usr/lib/mozilla/
root 3892 0.0 29.2 39668 27696 ? S 20:35 0:00 /usr/lib/mozilla/
root 3899 0.0 0.7 2636 748 pts/0 R 20:41 0:00 ps aux | |
| Boulware5 2002-12-21, 8:46 pm |
| ps aux should tell you all deamons you have running. You can then "grep it" to look for a particular daemon. ps aux shows everything running on your machine. | |
|
| quote: Originally posted by Boulware5
ps aux should tell you all deamons you have running. You can then "grep it" to look for a particular daemon. ps aux shows everything running on your machine.
Boulware5 nice talking to ya again!
Just to make sure I get this right, the command would be ps aux | grep smbd and then ps aux | grep nmbd???
If I'm wrong just let me know.
Thanks again everyone. | |
| Boulware5 2002-12-21, 9:43 pm |
| quote: Originally posted by Rcj2
Boulware5 nice talking to ya again!
Just to make sure I get this right, the command would be ps aux | grep smbd and then ps aux | grep nmbd???
If I'm wrong just let me know.
Thanks again everyone.
Yeah. Let me also ask you how you started up the daemons. When you compile it from source you start the nmbd and smbd daemons by:
$ /usr/local/samba/bin/smbd -D
$ /usr/local/samba/bin/nmbd -D
That is if it installed in /usr/local/samba which is the default if you compile from source.
With Binary installs it is started with "./smb start" in /etc/rc.d/init.d.
It's looking like this is the binary version (you let Red Hat install this during the install I imagine).
I'm not sure if this will help any, but probably can't hurt. You can check your smb.conf file by using the command:
./testparm
This is in your /usr/bin/ directory if you did not install by source.
Moreover, One of my guides says you can check the samba log files in in the /var/log/samba directory. In particular, the logs log.smbd and log.nmbd might be of interest to you.
Hopefully I didn't just blabber useless info you already knew.  | |
|
| Boulware5
Thanks for the help again. As far the installationn of Samba goes, I installed it when I installed Redhat 7.2 server. I chose to install Samba at that time. Right now I am currently at work so I can't check on the things you suggested. I will check them when I get home in the morning.
As far as your guides go, where did you get them and what are they?
Thanks again. | |
| Boulware5 2002-12-22, 12:31 am |
| devshed.com has a good one. | |
|
| Boulware5
OK here is some more info.
I tried to look at both of the directories
$ /usr/local/samba/bin/smbd -D
$ /usr/local/samba/bin/nmbd -D and did not have those. I also did a ps aux and found no Samba daemons running. I did however start the nmbd and smbd daemons by going to
cd/ etc/init.d and running the command ./smb start on both. I then could see both running when I grepped for them. I found something interesting when running the command ps -antp,
[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:139 0.0.0.0:* LISTEN 12725/smbd
tcp 0 0 127.0.0.1:1358 0.0.0.0:* LISTEN 12812/xinetd
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 1 0 192.168.0.112:2590 198.104.135.161:80 CLOSE_WAIT 12739/mozilla-bin
Does this mean that smb is running on port 139 and that xinetd is looking at port 1358?
Shouldn't it be looking at 901???
Maybe I am confused. Let me know what you think.
Thanks again for the help. | |
| Boulware5 2002-12-22, 2:32 pm |
| No...nmbd listens on port 137 and smbd listens on port 139. You should see swat on port 901.
Maybe there is a firewall rule blocking port 901 on your local computer. It's actually wise to do that so outsiders can't get in through port 901. But if you want to try to open swat locally, that's ok. Try this:
# ipchains -A input -p tcp -s 127.0.0.1 901 -j ACCEPT
-or-
If you use IPTables:
# iptables -A input -p tcp -s 127.0.0.1 --destination-port 901 -j ACCEPT
Then if that works you can add it to a startup script such as rc.local. May not be a good idea to keep that permanently open due to security. So give that a try. And I'd like to say I knew the ipchain/iptables format myself, but I had to look it up. One of these days I'll learn IpTables. | |
|
| Just another question, as far as the firewall goes can I use lokkit to turn it off? |
|
|
|