Fedora Linux Support Community & Resources Center
  #1  
Old 11th June 2012, 02:17 AM
Socrates440 Offline
Registered User
 
Join Date: May 2012
Location: Aspen
Posts: 48
linuxfirefox
/etc/hosts

I feel like I am asking a fairly stupid question, but can anybody tell me how to access and edit the /etc/hosts file. I feel like locating and opening it should be easy, yet I can not.
Reply With Quote
  #2  
Old 11th June 2012, 02:53 AM
nsnbm Offline
Registered User
 
Join Date: Dec 2007
Location: Melbourne, Australia
Posts: 162
linuxsafari
Re: /etc/hosts

The way I open /etc/hosts is to first open an xterm or some sort of xterminal and then in that terminal do:
Code:
su -
and enter root's password. Then I use the editor vim to open /etc/hosts with the command:
Code:
vim /etc/hosts
whereupon I can amend the file. The terminal that you use, and the editor you use are up to you. As regards these sorts of questions, I don't think any are stupid ... most of us didn't know something sometime.

Last edited by nsnbm; 11th June 2012 at 02:56 AM.
Reply With Quote
  #3  
Old 11th June 2012, 04:10 AM
marko's Avatar
marko Offline
Registered User
 
Join Date: Jun 2004
Location: Laurel, MD USA
Posts: 5,442
linuxfirefox
Re: /etc/hosts

vim is not really a very good editor for a beginner, it might be good to install the "nano" package and edit the file with nano
Reply With Quote
  #4  
Old 11th June 2012, 05:53 AM
Socrates440 Offline
Registered User
 
Join Date: May 2012
Location: Aspen
Posts: 48
linuxfirefox
Re: /etc/hosts

Thanks! That did it. I have actually been messing around a lot on VIM so I have gotten the hang of it.
Reply With Quote
  #5  
Old 11th June 2012, 08:25 AM
flyingfsck Online
Registered User
 
Join Date: Aug 2010
Location: Al Ain, UAE
Posts: 1,046
linuxfirefox
Re: /etc/hosts

Or from another machine on a LAN:
ssh -X -C -c arcfour128 root@server "gedit /etc/hosts"
Reply With Quote
  #6  
Old 11th June 2012, 09:12 AM
stevea's Avatar
stevea Offline
Registered User
 
Join Date: Apr 2006
Location: Ohio, USA
Posts: 8,298
linuxfirefox
Re: /etc/hosts

You may prefer the -Y to -X ssh option.

I wouldn't sweat the cipher selection '-c arcfour128', esp as /etc/hosts is user available info. Also arcfour (RC4) is considered to have weaknesses, maybe flyinf' chose it cuz it's fast.

I'd like to suggest that if you have a competent DNS service there is no need to ever diddle /etc/hosts.
__________________
None are more hopelessly enslaved than those who falsely believe they are free.
Johann Wolfgang von Goethe
Reply With Quote
  #7  
Old 11th June 2012, 10:07 AM
flyingfsck Online
Registered User
 
Join Date: Aug 2010
Location: Al Ain, UAE
Posts: 1,046
linuxfirefox
Re: /etc/hosts

Yup, arcfour128 is the fastest way to run SSH and still have pretty decent security. On some versions you can select cypher 'none', but that is never a good idea, not even on a LAN.
Reply With Quote
  #8  
Old 11th June 2012, 07:05 PM
droidhacker Offline
Registered User
 
Join Date: Oct 2009
Posts: 824
linuxfirefox
Re: /etc/hosts

Quote:
Originally Posted by Socrates440 View Post
I feel like I am asking a fairly stupid question, but can anybody tell me how to access and edit the /etc/hosts file. I feel like locating and opening it should be easy, yet I can not.
This is the kind of post that makes me twitch. The file "/etc/hosts" can be located precisely at "/etc/hosts".

---------- Post added at 02:05 PM ---------- Previous post was at 02:03 PM ----------

Quote:
Originally Posted by marko View Post
vim is not really a very good editor for a beginner, it might be good to install the "nano" package and edit the file with nano
It is precisely the fact that it is not good for a beginner, which is why it is GREAT for a beginner. Learn it now and be done.
Reply With Quote
  #9  
Old 14th June 2012, 08:39 PM
Socrates440 Offline
Registered User
 
Join Date: May 2012
Location: Aspen
Posts: 48
linuxfirefox
Re: /etc/hosts

Big thanks to everybody.
Reply With Quote
Reply

Tags
or etc or hosts

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
/etc/hosts.allow and hosts.deny bigmacbb63 Security and Privacy 9 19th March 2010 10:22 PM
how to configure hosts.allow and hosts.deny nkjha Security and Privacy 4 19th January 2009 03:10 PM
hosts FC6 and FC7 Anniedog Servers & Networking 0 24th August 2007 10:51 AM


Current GMT-time: 20:21 (Saturday, 18-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat