Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

editing conf files in etc/ directory

Status
Not open for further replies.

webscripter

Programmer
Jul 29, 2002
266
US
Hi everyone,

I'm trying to set up my modem in my new Linux installation.

My IP says to edit the following files in the etc directory

hosts, hosts.conf, resolve.conf hosts.allow, hosts.deny, resolve.conf, and /ppp/options.

It's my first time using the text editor. The editor won't save the file. Can I change root permissions from the text editor, or do I have to go into the shell mode. And how do I get into the shell to use pico? I'm using GNOME.

Is there a page with a list of commands I can refer to for changing permissions, directories, etc?
Thanks
Tricia
yorkeylady@earthlink.net
 

chmod changes permissions. Try 'man chmod'. But shouldn't you just 'su' to root to edit the files??


Cheers Henrik Morsing
IBM Certified AIX 4.3 Systems Administration
 
I'm new to Linux. I don't what su is or man chmod.

I'm an intermediate perl programmer (barnes N noble self learner).

I haven't studied but a few linux commands. That's next on my list. Is there a good ref page or tutorial?

If I could sign on the web in Linux it would be much easier to study. Till I can configure my modem correctly, I have to go back and forth between Windows and Linux.

Earthlink is my IP and they have a help page at
that I'm trying to follow. Could you look at that and tell me if it's up to date?

Also is there a way to access the list of shell commands from the help index in Linux? Thanks
Tricia
yorkeylady@earthlink.net
 
Tricia

"man" is the command that will save your life.

When you boot into linux in console (prompt) mode, type in the command "man chmod"

what you will see is a help page that tells you more than you ever wanted to know about chmod.

"man su" will tell you about su...

rinse later and repeat

The command "su" is the command you use to change from your current user into the "root" user. Root is "God" on your machine. Root can do anything, so be VERY careful with it.

Now, a different scenario... Assuming you are in X-Windows mode (that's assumed because you wanted to find a terminal to do things in)... click on the Gnome footprint in the bottom right hand corner of your screen. That's like the start menu in Windows. Look through those menus until you see the option for Terminal...

The reason you cannot save using the text editor is most likely because you are logged in as "Tricia" and not as "root" on your local machine.

Find your terminal session. Su into root. Navigate into the /etc directory. Use pico or vi or emacs or whatever you want to edit the files you want. If you use pico, then you hit CTRL-X to exit and save the document. If you use vi, then you ESC-:-wq to exit and save.

I would highly suggest you buy a Linux for Dummies book. If you are a perl programmer ala' B&N, then you can grab a cheap Linux book as well.

--DW

-----
Daryl W. Hunter
Director of Information Technology
Ennovation Associates, LLC.
daryl.hunter@ennovationai.com

daryl@hunterfam.net
 
su is what you type in a terminal window to temporarily change from your current user to root. You will be asked for the the root password. Try it - notice the prompt change. Type exit to return to your normal user.

man chmod is another command to type in a terminal window. 'man' is the usermanual, 'chmod' is the name of the command. So when someone tells you 'man command' type this in a terminal window to get the manual page for this command. For refererence, try man man.

The reason/solution for your problems are: you can not save because your normal user doesn't have permission to. Morsing is telling you to open a terminal window (sometimes called a console or shell), change to root (by typing su) then pico. Root does have permission to save the file, so you'll be all set.

I don't use Gnome, but look through your menus - there should be several terminals, consoles, and/or shells.
 
This is getting easier as I go. The only problem I'm having is navigating through the directories.

With dir command I can see the directories. etc/ isn't there at the root localhost . cd to change directories. But how do I go up the directory tree?

When I use the Find File tool it finds the file etc/hosts.allow. But when I look for it in the terminal window it's not there.

One more question. I forgot how to enter pico from the command prompt. It's been over a year since I've been in shell mode.

Thankyou much for all your help.

Thanks
Tricia
yorkeylady@earthlink.net
 
To move up one directory at a time:
cd ..

To move to the top of the directory structure:
cd /

If pico is installed, all you need to do is type pico. You may also have emacs, gedit, and vi
 
If you feel more at ease in the graphics mode, you can use gedit to edit your text files. It will feel a lot like Windows' notepad.
 
I'm confused about file structure.

It looks as though when a superuser is added they get their own directory because it mentions their user name. But I'm guessing that this is just a prompt.

Also in the root prompt their are only 2 directories and the phone files I'm looking for aren't there.

But when I'm in the normal mode they're at /etc which seems to me as though it should be the root.

Where can I learn about directory structure?

Thanks
Tricia
yorkeylady@earthlink.net
 
Tricia, the unix file structure is basically a 'root' filesystem (/) from which all or most other filesystems are attached rather like the root system of a tree, each 'branch' going deeper into the filesystem and therefore further away from the top, ie / the home directory of user root. The position of a file in the directory structure is called a pathname, because it describes the path needed to navigate to the file in question through the directory hierarchy.

That being so, a pathname like /data1/users/print/report1 describes the path to be taken to get to the report1 file, and it can be navigated using either:

cd /data1/users/print and then, say, lp -dprinter1 report1

or by cding through the individual directories themselves:

cd data1
cd users
cd print
lp -dprinter1 report1

Alternatively the file can be printed using it's full pathname thus:

lp -dprinter1 /data1/users/print/report1

/etc can probably just be entered by typing cd /etc from the root directory. You can verify that you're there by issuing a pwd command and noting the result (it should be /etc).

I hope this helps. Incidentally, does Yorkeylady indicate a Yorkshire connection - I'm an exiled Tyke myself. Cheers.
 
My favorite dog is the Yorkshire Terrier. Some day I hope to raise yorkies while I'm sitting in my home programming.
I live in the mountains and it's very boring out here. But at least I can breathe. (Asthma problem)

I wish my modem would connect from linux. This is a drag going back and forth from windows to linux to get on the net.

I'm having trouble because my IP (earthlink) doesn't have tech support for linux users. Should I change my dialup IP to aol? Thanks
Tricia
yorkeylady@earthlink.net
 
Just a note, it's ISP (Internet Service Provider), not IP (Internet Protocol). //Daniel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top