PCLinuxOS-Forums
News: ...FLASH!!! ...New PCLinuxOS Testing board now open. Register today! Be an active contributor to the PCLinuxOS future! ... Read all about it now, on THIS forum!!!..
 
*
Welcome, Guest. Please login or register. May 27, 2012, 12:46:52 PM


Login with username, password and session length


Pages: [1]   Go Down
  Print  
Author Topic: SSH to your hostname  (Read 817 times)
melodie
Hero Member
*****
Offline Offline

Posts: 6005


XMMP=Jabber, free instant messaging protocol !


WWW
« on: August 10, 2011, 10:20:09 AM »

After we saw how to change hostnames in PCLinuxOS, Change hostname PCLinuxOS, it might be cool to ssh directly the hostname of the remote machine. To do that, all is needed is add an alias in the /etc/hosts in the machine where you want to start the command.

Here at first floor my machine's name is "herisson". At the ground floor it's "hulotte". I added the ip and hostname of the remote machine in /etc/hosts:
Code:
192.168.1.8 hulotte

so from "herisson" I can just "ssh melodie@hulotte".

In the paste I also used a script that was allowing connection to my remote machine without providing the password each time, I will try to find it.

Logged

melodie at swissjabber dot ch - IRC #pclinuxos-fr sur freenode
AndrzejL
PCLinuxOS Tester
Super Villain
*******
Offline Offline

Posts: 11990


Registered Linux User #490933


WWW
« Reply #1 on: August 10, 2011, 10:38:48 AM »

Right... I prefer this way. PCC > Network and Internet > Host definitions.




Regards
Logged

melodie
Hero Member
*****
Offline Offline

Posts: 6005


XMMP=Jabber, free instant messaging protocol !


WWW
« Reply #2 on: August 10, 2011, 10:40:24 AM »

Hi,
I never know what to do with "yourdomain", could you explain ?

Logged

melodie at swissjabber dot ch - IRC #pclinuxos-fr sur freenode
AndrzejL
PCLinuxOS Tester
Super Villain
*******
Offline Offline

Posts: 11990


Registered Linux User #490933


WWW
« Reply #3 on: August 10, 2011, 10:50:02 AM »

Hi,
I never know what to do with "yourdomain", could you explain ?

It can be anything. Flower / thenudiebar / whatever.

If You use lets say 192.168.0.120 and then thenudiebar instead of yourdomain when You will ping thenudiebar it will ping the IP mentioned above.

I use it as well for blocking certain page...

127.0.0.1 facebook.com
127.0.0.1 myspace.com

If anyone tries to visit those pages he gets error...

Btw - this method of hostnaming the pcs has a major flaw... all the machines have to have static IP in your network...

I use static IP - yes. If You use this method You have static IPs too... but sometimes people connect machines via DHCP - this method will fail then - as machines will have different IP each time.

Andy
Logged

melodie
Hero Member
*****
Offline Offline

Posts: 6005


XMMP=Jabber, free instant messaging protocol !


WWW
« Reply #4 on: August 10, 2011, 01:40:53 PM »

Very true, I also use fixed ip's on the lan.

So you say "yourdomain" is my "herisson" at first floor, "hulotte" at ground floor, and "localhost" in the other default pclinuxos configurations ?

Logged

melodie at swissjabber dot ch - IRC #pclinuxos-fr sur freenode
AndrzejL
PCLinuxOS Tester
Super Villain
*******
Offline Offline

Posts: 11990


Registered Linux User #490933


WWW
« Reply #5 on: August 10, 2011, 01:55:00 PM »

Very true, I also use fixed ip's on the lan.

So you say "yourdomain" is my "herisson" at first floor, "hulotte" at ground floor, and "localhost" in the other default pclinuxos configurations ?

Yes that's what it is. There is no limit of the entries so you can add multiple hostnames for 1 ip. Just like there are 2 lines for my 127.0.0.1 ip on my screenshot.

Andy
Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM