Re: [Dorset] Can I use hostnames with ssh without editing /etc/hosts
Message: 3 Date: Mon, 12 Aug 2013 14:32:39 +0100 From: Andrew To: dorset@mailman.lug.org.uk Subject: Re: [Dorset] Can I use hostnames with ssh without editing /etc/hosts Message-ID: <5208e3f7.1050...@ziltro.com> Content-Type: text/plain; charset=UTF-8; format=flowed On 12/08/2013 14:04, JD wrote: My problem is that I would like to use hostnames and not IP addresses when linking between 3 Linux computers that are just connected via my router. The router has the correct hostname for each computer but I get a refusal if I try, say, jd@jd-Dimension-5000, whereas jd@192.168.1.5 works. In principle, the IP addresses change so I'd rather use hostnames. I admit that the IP addresses don't change very often, but I turn the router off whenever I go away so the addresses get reassigned and that is a pain. Thanks for the suggestions. Andrew's recommendation - use "hostname.local" does work so I shall use that. For completeness: Ralph, the failure message was "ssh: connect to host jd-Dimension-5000 port 22: Connection refused". Tim, I want to use my Pi for many other projects, some on the 'bare metal' so I won't make it the DNS. I've also had a suggestion from a friend here in very rural Dorset. Configure my router to allocate static IP addresses. This seems to be possible with the Huawei but the GUI is tortuous and there is no manual. John PS The above looks a bit of a mess. How should I reply to replies? -- Next meeting: Bournemouth, Tuesday, 2013-08-06 20:00 Meets, Mailing list, IRC, LinkedIn, ... http://dorset.lug.org.uk/ New thread on mailing list: mailto:dorset@mailman.lug.org.uk How to Report Bugs Effectively: http://goo.gl/4Xue
Re: [Dorset] Can I use hostnames with ssh without editing /etc/hosts
Tim, I want to use my Pi for many other projects, some on the 'bare metal' so I won't make it the DNS. I've also had a suggestion from a friend here in very rural Dorset. Configure my router to allocate static IP addresses. This seems to be possible with the Huawei but the GUI is tortuous and there is no manual. Whoa!!! You don't configure static IP addresses at the router. They are done on the individual hosts/devices. My router is 192.168.1.1, I have DHCP set up for 192.168.1.2 --> 192.168.1.8 and my Raspberry Pi set up to a fixed IP address of 192.168.1.11. This computer used to be DHCP but is now fixed at 192.168.1.12 as it is the connection for a shared printer on my network. I ended up fixing the IP address of the RPi because I hated having to find it out every time I wanted to ssh into it. FWIW my netmask is 255.255.255.240 This limits the range of static IP addresses that you can use. Peter -- Next meeting: Bournemouth, Tuesday, 2013-08-06 20:00 Meets, Mailing list, IRC, LinkedIn, ... http://dorset.lug.org.uk/ New thread on mailing list: mailto:dorset@mailman.lug.org.uk How to Report Bugs Effectively: http://goo.gl/4Xue
[Dorset] Computers for foreign countries
Does anyone know of any charity that does up computers for sending to foreign lands and wants some components? I am having a clearout and have mostly wireless stuff (Symbol, Netgear and Intel) and some Ethernet cards and a couple of Video cards. I think all of the wireless kit predates WAP actually. My computers all take PCI cards now and this stuff predates that, but is still in working order and in most cases with the driver disks. Thanks, Peter M -- Next meeting: Bournemouth, Tuesday, 2013-08-06 20:00 Meets, Mailing list, IRC, LinkedIn, ... http://dorset.lug.org.uk/ New thread on mailing list: mailto:dorset@mailman.lug.org.uk How to Report Bugs Effectively: http://goo.gl/4Xue
Re: [Dorset] Can I use hostnames with ssh without editing /etc/hosts
Hi Peter, > > I've also had a suggestion from a friend here in very rural Dorset. > > Configure my router to allocate static IP addresses. > > Whoa!!! You don't configure static IP addresses at the router. They > are done on the individual hosts/devices. Perhaps what John's friend was suggesting it to configure the DHCP server on the router to always give a particular IP address out to a particular MAC address when it comes calling. That way, all the other devices continue with their default of using DHCP to obtain an IP address but they happen to be given the same one each time. Well, until you upgrade the motherboard and the MAC address changes. Cheers, Ralph. -- Next meeting: Bournemouth, Tuesday, 2013-08-06 20:00 Meets, Mailing list, IRC, LinkedIn, ... http://dorset.lug.org.uk/ New thread on mailing list: mailto:dorset@mailman.lug.org.uk How to Report Bugs Effectively: http://goo.gl/4Xue
Re: [Dorset] Can I use hostnames with ssh without editing /etc/hosts
Hi John, > > > The router has the correct hostname for each computer but I get a > > > refusal if I try, say, jd@jd-Dimension-5000, whereas > > > jd@192.168.1.5 works. > > Ralph, the failure message was "ssh: connect to host jd-Dimension-5000 > port 22: Connection refused". OK, that means jd-Dimension-5000 could be turned into an IP address but no SSH daemon was listening on the default port of 22 so the machine clearly responded with a "nothing's listening, connection refused". So jd-Dimension-5000 didn't become the 192.168.1.5 you give above but something else; something that doesn't run sshd on port 22. To find out what you could use strace to observe the connect(2) system call that's getting the error from the kernel. That will show the IP address that ssh has already worked out as it is passed to the kernel. Here, I've pretended it's 1.2.3.4. Other connects might fail beforehand but they aren't interesting ones so I've elided them. $ strace -e connect ssh jd-Dimension-5000 ... connect(3, {sa_family=AF_INET, sin_port=htons(22), sin_addr=inet_addr("1.2.3.4")}, 16) = -1 ECONNREFUSED (Connection refused) ssh: connect to host jd-Dimension-5000 port 22: Connection refused $ The IP address ssh it uses might give a clue. The other place to look is $ cat /etc/host.conf # The "order" line is only used by old versions of the C library. order hosts,bind multi on $ which normally says that /etc/hosts should be consulted before trying the "bind" method. Perhaps /etc/hosts contains an old definition for jd-Dimension-5000? > PS The above looks a bit of a mess. How should I reply to replies? It wasn't too bad. You deleted a lot of the extra stuff. I'm not too sure what to suggest other than watch what others do and see what you like and dislike. Many just type their lines at the top, where the cursor is initially placed, without deleting any of the ever-growing quoted reply that follows. :-) Cheers, Ralph. -- Next meeting: Bournemouth, Tuesday, 2013-08-06 20:00 Meets, Mailing list, IRC, LinkedIn, ... http://dorset.lug.org.uk/ New thread on mailing list: mailto:dorset@mailman.lug.org.uk How to Report Bugs Effectively: http://goo.gl/4Xue
Re: [Dorset] Computers for foreign countries
On 17/08/13 20:56, Peter Merchant wrote: Does anyone know of any charity that does up computers for sending to foreign lands and wants some components? I am having a clearout and have mostly wireless stuff (Symbol, Netgear and Intel) and some Ethernet cards and a couple of Video cards. I think all of the wireless kit predates WAP actually. My computers all take PCI cards now and this stuff predates that, but is still in working order and in most cases with the driver disks. Thanks, Peter M Don't know any charity for oversea, but there is Jamies in the Southampton area http://www.jamies.org.uk/ They also sale refurbished kit as well Tim -- Next meeting: Bournemouth, Tuesday, 2013-08-06 20:00 Meets, Mailing list, IRC, LinkedIn, ... http://dorset.lug.org.uk/ New thread on mailing list: mailto:dorset@mailman.lug.org.uk How to Report Bugs Effectively: http://goo.gl/4Xue
Re: [Dorset] Can I use hostnames with ssh without editing /etc/hosts
Hi, On Sat, Aug 17 at 08:44, Peter Merchant wrote: ... > Whoa!!! You don't configure static IP addresses at the router. They are > done on the individual hosts/devices. A static IP address can be configured by the router using DHCP in fact I find this a very useful feature of DHCP. All my portable devices are configured as DHCP clients to get dynamic addresses from any network they are on. When on the home network, the home router supplies them with static addresses via DHCP so I can easily access them. All the machines at work (and we have hundreds) have static addresses assigned via DHCP from a central router. If we need to reconfigure the network we'd only need to hit the one server rather than manually reconfigure each individual machine. Dynamic addresses are only issued in a narrow range for guest devices and this is used as a big security hint to various firewalls and servers. -- Bob Dunlop -- Next meeting: Bournemouth, Tuesday, 2013-08-06 20:00 Meets, Mailing list, IRC, LinkedIn, ... http://dorset.lug.org.uk/ New thread on mailing list: mailto:dorset@mailman.lug.org.uk How to Report Bugs Effectively: http://goo.gl/4Xue