LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-23-2007, 05:57 PM   #1
stupeas
Member
 
Registered: Jan 2007
Location: Manchester/U.K
Distribution: Mandriva Free 2007
Posts: 30

Rep: Reputation: 15
Smile Viewing etc/passwd


Im currently doing my CIW certification and have installed Mandriva Free to help me learn. At the moment im learning about user accounts. I know that there is no longer any need to edit files manualy to add a user, but i want to at least see the contents of the etc/passwd file for myself.
The problem is that it is locked and for some reason when i initialy try to log in to my system as root, im told that it is not possible to log on as root. Once im in KDE then i can use a terminal to log in as root (with su root), but when i close the terminal and go back to the hard drive to view its files, the etc folder is still locked.

Please note that i know the dangers of messing with the system configuration files and i dont actualy plan to change anything. All i realy want to know it how to open these locked files in a word processor (Whats the Linux equivelent of notepad???).

Thanx in advance.
Stuart
 
Old 03-23-2007, 06:20 PM   #2
truthfatal
Member
 
Registered: Mar 2005
Location: Winnipeg, MB
Distribution: Raspbian, Debian, Slackware, OS X
Posts: 443
Blog Entries: 9

Rep: Reputation: 32
When you go to the terminal and `su root` it is only in that terminal that you are root.
You need to do all your work from inside that terminal to view root only files.

You probably not able to log in initially as root because root X logins may have been disabled on your machine.
 
Old 03-23-2007, 07:48 PM   #3
stupeas
Member
 
Registered: Jan 2007
Location: Manchester/U.K
Distribution: Mandriva Free 2007
Posts: 30

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by truthfatal
When you go to the terminal and `su root` it is only in that terminal that you are root.
You need to do all your work from inside that terminal to view root only files.

You probably not able to log in initially as root because root X logins may have been disabled on your machine.
O.K Thanks. So how then, do i view these files (in a text editor) OR change the system to allow root X logins.
 
Old 03-23-2007, 08:13 PM   #4
DJNolz83
Member
 
Registered: Aug 2006
Distribution: Ubuntu
Posts: 91

Rep: Reputation: 15
Probably the best way to look at the files woul dbe to go through a text-based editor (like vi) thusly:

su
(type root password)
vi /etc/passwd

Bear in mind that you may end up destroying this file if you are not careful (you do have root permissions, which gives you read/write access to this file) - which is why it would be a good idea to use vi.
Alternatively, you can:

su
(type root password)
gedit /etc/passwd

to give you a view much like the windows version of notepad. (gedit if you are gnome, kedit if you are KDE)

Cheers
Damo
 
Old 03-23-2007, 09:09 PM   #5
ethics
Senior Member
 
Registered: Apr 2005
Location: London
Distribution: Arch - Latest
Posts: 1,522

Rep: Reputation: 45
i use joe or nano, i find them simplaer than vi, they only have one mode. Vi however should be learnt when you can
 
Old 03-24-2007, 01:50 AM   #6
jonwatson
Member
 
Registered: Jun 2004
Location: Nova Scotia, Canada!
Distribution: Ubuntu
Posts: 170

Rep: Reputation: 30
Since you're in KDE, you can press the ALT and F2 keys together. That will bring up a command window. Type in 'kdesu kate' without the quotes.

You will be prompted for your root password. Type it in and Kate (a text editor) will open but the 'kdesu' part opens it as the root user. You can then do a File -> Open and browse to the /etc/passwd file and open it.
 
Old 03-24-2007, 05:25 AM   #7
stupeas
Member
 
Registered: Jan 2007
Location: Manchester/U.K
Distribution: Mandriva Free 2007
Posts: 30

Original Poster
Rep: Reputation: 15
Thanx Everyone. Much Appreciated
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Swat uses PAM but changes linux passwd not samba passwd Peter@KKVS Linux - Networking 0 11-26-2006 05:20 AM
what is /etc/passwd- for? xpucto Linux - Security 7 11-22-2006 05:47 PM
passwd romel Linux - Security 1 04-25-2004 02:12 AM
can't passwd leihsun Linux - General 17 06-19-2002 06:37 AM
passwd Winter Linux - Security 2 05-01-2002 06:13 PM


All times are GMT -5. The time now is 08:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration