I modified the /etc/hosts file to include the address of the machines with a static IP address. After all, these are the only machines I need access to from OS X. Here are the steps I followed:
- Sign in as an administrator (or an account belonging to the sudousers group)
- Launch a terminal shell (Applications > Utilities > Terminal if you are using Finder or type terminal in Spotlight)
- Run the command sudo vi /etc/hosts
- Scroll to the end of the file
- Type i to enter insert mode
- Press the enter key to start a new line (my vi skills are weak as it has been years since I have used it - there is probably a better way to append to the end of a file)
- Enter the IP address, press the tab key, then enter the name machine
- Press the esc key to get out of insert mode
- Press :wq to save the changes and quit vi
To add info to end of a file, you could:
echo "info....">>filename.
Add Your Comment
