Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
SMS Forum Index » SMS User Support

Post new topic   Reply to topic
SSH oddity
View previous topic :: View next topic  
Author Message
toothandnail
Member


Joined: 17 Mar 2011
Posts: 63
Location: Oxfordshire, UK

PostPosted: Tue Apr 23, 2013 5:58 pm    Post subject: SSH oddity Reply with quote

I've finally got my SMS server in the system replacing my ancient Amahi server, providing DNS and DHCP for my network, using Dnsmasq (just built the most recent version).

Not set the printer up yet (I need to set it up to use Samba, since I sometimes have to use Windows and need to have the printer available from there), but most everything else seems to be working.

I have hit one strange thing. I can mount samba and nfs shares, but I've been unable to ssh into the machine by name - this is what I get:

Code:
fang@sirius:~$ ssh root@sms
ssh: connect to host sms port 22: Connection refused


On the other hand, if I ssh in to the IP, it works fine.

Also, when I attempt to mount an NFS share by name, it times out, but works fine when mounting by IP instead.

I suspect I've got something incorrectly set, but I'm not sure what it could be. Any clues as to where I should be looking? I thought it might be something in /etc/hosts, but I think this is correct:

Code:
# For loopbacking.
127.0.0.1               localhost
127.0.0.1               sms.ibmpeers.net sms


Smile Now to see if I can get my printer connected and working for the network...

Paul.
Back to top
View user's profile Send private message
gerasimos_h
Site Admin


Joined: 09 Aug 2007
Posts: 1752
Location: Greece

PostPosted: Tue Apr 23, 2013 6:32 pm    Post subject: Reply with quote

It's a typical DNS problem...
If you are trying to connect from a windows machine and samba is running (nmbd) you will have name resolution.

On unix machines though you need to run a proper DNS or both machines must run a zeroconf implementation such avahi.
There is a simpler solution though, by just adding hostname and ip of the machines to /etc/hosts e.g. "192.168.2.2 myservername" on clients, so they can easily resolv name through network...

gerasimos_h

_________________
Superb! Mini Server Project Manager
http://sms.it-ccs.com
Back to top
View user's profile Send private message Visit poster's website
toothandnail
Member


Joined: 17 Mar 2011
Posts: 63
Location: Oxfordshire, UK

PostPosted: Tue Apr 23, 2013 7:49 pm    Post subject: Reply with quote

gerasimos_h wrote:
It's a typical DNS problem...
If you are trying to connect from a windows machine and samba is running (nmbd) you will have name resolution.


Smile Haven't tried from a Windows machine, though I do sometimes have to use Windows.

Quote:
On unix machines though you need to run a proper DNS or both machines must run a zeroconf implementation such avahi.


I was under the impression that Dnsmasq should provide a proper DNS implementation, unless I've got something incorrectly set in its config.

Since I entered the original message, I've found a couple of other things - I can't access http services by name (either the front page or Webmin), but can access them by IP. However, I can ping the machine by name, and the avahi browser shows the sms machine.

Quote:
There is a simpler solution though, by just adding hostname and ip of the machines to /etc/hosts e.g. "192.168.2.2 myservername" on clients, so they can easily resolv name through network...


Smile I guess I may be forced to do that, but I'd much prefer to work out what is incorrectly set so I don't have to do so.

I guess I'll have to have another look at the dnsmasq.conf.

Paul.
Back to top
View user's profile Send private message
gerasimos_h
Site Admin


Joined: 09 Aug 2007
Posts: 1752
Location: Greece

PostPosted: Tue Apr 23, 2013 8:59 pm    Post subject: Reply with quote

If you setup DNS server then you need to set the DNS server at clients, by adding SMS at top in /etc/resolv.conf of the clients...
Of course in a proper office setup, SMS server would be the DHCP server as well so you wouldn't have to do that, but I believe you have a home network...

You can also use the Name resolution (DNS) from your adsl router, if it has one e.g. Thomson, since that's the default DHCP server usually at home networks....

Avahi by default advertise http, smb and ssh, but your clients should run avahi too for this to work...

If you have 2-3 machines it's simpler to add server in /etc/hosts of clients, if you have a lot of machines, it's better to setup SMS as DHCP/DNS also, unless avahi do the job, especially if you have a Mac in your network...

gerasimos_h

_________________
Superb! Mini Server Project Manager
http://sms.it-ccs.com
Back to top
View user's profile Send private message Visit poster's website
toothandnail
Member


Joined: 17 Mar 2011
Posts: 63
Location: Oxfordshire, UK

PostPosted: Tue Apr 23, 2013 11:06 pm    Post subject: Reply with quote

Sorry, should have been clearer. I'm using dnsmasq as both DHCP and DNS server. All the other devices on my network are set to DHCP, and I have dnsmasq reserving IPs for things that I need to be on specific IPs (I have a Linksys NSLU2 which talks to a PVR and a Raidsonic NAS, so both of them have IPs reserved in /etc/dnsmasq.conf).

External DNS resolution is fine, as is most of the local resolution - this is a dump from /var/lib/misc/dnsmasq.leases:

Code:
root@sms:/var/lib/misc# cat dnsmasq.leases
1366774184 20:f3:a3:e3:05:f9 192.168.1.128 android-94194b1674f8d460 *
1366785230 00:14:bf:70:9b:36 192.168.1.77 unslung *
1366792973 00:1e:65:19:f9:be 192.168.1.102 saline *
1366793264 00:01:d2:04:0b:d8 192.168.1.2 openwrt *
1366793037 00:23:7d:50:a2:bb 192.168.1.136 deneb *


I can address any of the internal machines by name, with the exception of the SMS machine. I've also discovered the reason I was getting 'permission denied' errors when trying to ssh to the SMS machine from my laptop - the laptop does not have the SSH daemon enabled. I tried doing the same from my desktop machine, which does have the SSH daemon running. In that instance, I was able to log in, but on checking found that it was actually SSHing to itself, which make no sense to me at all.

This is what I've got in dnsmasq.conf:

Code:
# Configuration file for dnsmasq.
#

domain-needed
bogus-priv

resolv-file=/etc/nameserver.list
#server=/localnet/192.168.1.1
local=/ibmpeers.net/
domain=ibmpeers.net
expand-hosts
dhcp-range=192.168.1.100,192.168.1.200,12h

dhcp-host=00:01:d2:04:0b:d8,openwrt,192.168.1.2
dhcp-host=00:14:BF:70:9B:36,unslung,192.168.1.77

#listen-address=127.0.0.1
dhcp-option=option:router,192.168.1.1

# Set the NTP time server addresses to 192.168.0.4 and 10.10.0.5
#dhcp-option=option:ntp-server,192.168.0.4,10.10.0.5
# Set the NTP time server address to be the same machine as
# is running dnsmasq
#dhcp-option=42,0.0.0.0
dhcp-option=vendor:MSFT,2,1i
dhcp-authoritative


resolv.con is this:

Code:
domain ibmpeers.net
server 127.0.0.1


I also have an extra file (/etc/nameserver.list) which lists external nameservers:

Code:

server 8.8.8.8
server 8.8.4.4


As you said, it certainly looks like a DNS issue, but I must be missing something to get this strange error....

Thanks for the suggestions.

Paul.
Back to top
View user's profile Send private message
gerasimos_h
Site Admin


Joined: 09 Aug 2007
Posts: 1752
Location: Greece

PostPosted: Tue Apr 23, 2013 11:28 pm    Post subject: Reply with quote

First can you resolv sms.ibmpeers.net from SMS?
Code:
dig sms.ibmpeers.net
dig sms


Also at /etc/resolv.conf should be
Code:
nameserver 127.0.0.1


And finaly in /etc/hosts use the LAN IP address instead of the 127.0.0.1...

gerasimos_h

_________________
Superb! Mini Server Project Manager
http://sms.it-ccs.com
Back to top
View user's profile Send private message Visit poster's website
toothandnail
Member


Joined: 17 Mar 2011
Posts: 63
Location: Oxfordshire, UK

PostPosted: Wed Apr 24, 2013 12:29 am    Post subject: Reply with quote

gerasimos_h wrote:
First can you resolv sms.ibmpeers.net from SMS?
Code:
dig sms.ibmpeers.net
dig sms


Both of those worked.

Quote:
Also at /etc/resolv.conf should be
Code:
nameserver 127.0.0.1


Changed. I had it that way originally but changed it in one of my attempts to get it working.

Quote:
And finaly in /etc/hosts use the LAN IP address instead of the 127.0.0.1...


That was the critical one. Changed and its now working fine - I can open the SMS web pages using "http://sms" and I can also ssh into the machine using it name.

Many thanks.

Paul.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    SMS Forum Index » SMS User Support All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
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
You can attach files in this forum
You can download files in this forum

SMS - Superb! Mini Server Project © 2016
Powered by phpBB © 2001, 2002 phpBB Group
iCGstation v1.0 Template By Ray © 2003, 2004 iOptional