just a beginner in linux i am not able to add or remove programs from the first user of ubuntu as i changed the settings of user properties thinking that i can do so in root but root has no graphical interface like the basic user

Asked by manu

i am new to linux. i installed it 2 days back. while gathering information about linux on net i read that one should not work in root for routine work. while exploring ubuntu i went to system->administrator->user and groups. there was only one user ie the basic user 'manu'. i saw no root in the user so i thought i should create one. i created a new user 'root' and gave it administrative access in the properties. i disabled the administrative access for the basic user 'manu' in the properties. when i logged in again. i found that there is no option for add or remove program neither is there system->administrator->user and groups option available for the basic user 'manu'. Then i logged of 'manu'. and entered the user name 'root' and its password. but it displayed that "root cant login from here". then i again looked into internet on how to get graphical interface for root. there were written some commands like sudo, gksudo etc. i tried many things but could not achieve anything.NOW
1)i have lost the acess of administrator
2)i cant add or remove programs
what should i do so that i can access the user accounts and change the properties of basic user 'manu' and have the administrative access once again

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
manu
Solved:
Last query:
Last reply:
Revision history for this message
Tom Molin (tom-molin) said :
#1

There may be several ways to solve this issue.

If you did enable the root user (And you shouldn't do this with a ubuntu system, it's better to use sudo for admin stuff)? Then you can try to log on to the text based virtual terminal. You access this by pressing ctl+alt+<F1>. If you succeed to log on as root you can use the command 'visudo' to give your user admin (sudo) access. When you're done and want to go back you'll find the graphical interface on virtual TTY 7 (crl+alt+<F7>

Another way to solve this is more complicated for a newstarter, but it involves booting the system into single user mode and edit the /etc/sudoers and/or /etc/passwd & /etc/shadow file from there. In that case I rather recommend that you reinstall the system.

Revision history for this message
manu (purimanu2000) said :
#2

i pressed ctl+alt +f1
i wrote root and its password
i wrote visudo and got the following on a black screen

#/etc/sudoers
#this file must be edited with 'visudo' command as root
#see the man page for details on how to write a sudoers file
#host alias specification
#user alias specification
#command alias specification
#defaults

defaulters !leture,fly-tickets,fqdn

#user privilege specification
root ALL=(ALL)ALL
#members of the admin group may gain root priviledges
%admin ALL=(ALL)ALL

^G GET HELP ^O WRITE OUT ^R READ FILE ^Y PREVIOUS PAGE ^K CUT TEXT ^C CUR POS
^X EXIT ^J JUSTIFY ^W WHERE IS ^V NEXT PAGE ^V VIRTUAL TEXT ^T TO SPELL

being unable to know what to do next, i again need some help

Revision history for this message
Tom Molin (tom-molin) said :
#3

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

manu wrote:

| root ALL=(ALL)ALL
You add your account:
1. make a new (empty) line
2. Add the following (if your account name is manu):
manu ALL=(ALL)ALL

3. Save and quit. All should be good now. Good luck! :)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkleGq0ACgkQyKh9uxg0QX06fwCePW7t4qN26bBDaJebvZ3fz65e
tO0An03cvRR2po7G0UrtFQEeaGy+sdLZ
=5Sp8
-----END PGP SIGNATURE-----

Revision history for this message
manu (purimanu2000) said :
#4

 root ALL=(ALL)ALL (it was already written, i pressed enter and wrote:)
 manu ALL=(ALL)ALL

#member of the admin group may get root priviledge
%admin ALL=(ALL)ALL

i pressed ctrl 0 (to write)

it showed
file name to write: /etc/sudoers.tmp (cursor was blinking here)

i dont know what to do now

Revision history for this message
manu (purimanu2000) said :
#5

root ALL=(ALL)ALL (it was already written, i pressed enter and wrote:)
 manu ALL=(ALL)ALL

#member of the admin group may get root priviledge
%admin ALL=(ALL)ALL

i pressed ctrl 0 (to write)

it showed
file name to write: /etc/sudoers.tmp (cursor was blinking here)

^G GET HELP ^T TO FILES M-M MAC FORMAT M-P PREPEND
^C CANCEL M-D DOS FORMAT M-A APPEND M-B BACKUP FILE

unable to understand this i pressed ^c to cancel
it showed [CANCELLED]

i pressed ^x to exit
it showed

save changes to modified builder y or n

if i press y it shows--
file name to write: /etc/sudoers.tmp (cursor was blinking here)

^G GET HELP ^T TO FILES M-M MAC FORMAT M-P PREPEND
^C CANCEL M-D DOS FORMAT M-A APPEND M-B BACKUP FILE

if i press n, then i am back to square one

plz help

Revision history for this message
Wim (launchpad-xs4all) said :
#6

Manu,

if your PC boots up, you see (for a few seconds) something like "Press <Esc> to enter Grub menu"
Press <Esc>
you will see a few lines on the screen, the second
is something like:
Ubuntu-08-10-1,kernel.....(recovery mode)
select this line and press <Enter>

This will end up in commandline-linux, stating like root@PC-name:$

now enter these commands (all between brackets is my command for you)

cd /etc

vi /etc/group

(go with arrow-down until you are at the line
admin:x:115:.....)

(now press the exact sequense of keys i give here: the first is capital-A, rest are small, the last thing is the key <Esc>, so do not type < E, s, C, >...)
( !! if there is already a name after the 115: then enter the string)

     A,manu<Esc>

( !! if there is no name after the 115: then enter the string)

     Amanu<Esc>

(now you will see something on this line like
admin:x:115:othername,manu or like
admin:x:115:manu
(if this went OK then save and quit the file, press, semicolon+small-caps)

   :w
   :q

(if something goes wrong then do not save it, press)

  :q!

(If previous ended up OK, then you can restart, and log in as MANU, which has all privilege again)

   init 6

(the PC reboots, log in as manu, and correct things)
To ALL readers:
* never create a ROOT user yourself
* create (as first user) some-name who has ALL rights to do EVERYTHING on your machine
* after installation, create a SECOND user (your NickName) who has just sufficient rights to do your "dayly normal" work.
* Only log in with the FIRST user if you want to change something on your installation, and if you want to change rights
(This TIP works with other OS-es too)

Problem solved, Manu?!?

Revision history for this message
manu (purimanu2000) said :
#7

great
its done '
thanks a lot