LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   cant login as root (https://www.linuxquestions.org/questions/linux-newbie-8/cant-login-as-root-115912/)

nick2003 11-14-2003 07:14 AM

cant login as root
 
Hi, I cant seem to login as root, When i open the konsole and try to type login it tells me cannot change permissions of TTY operation not permited, it was working when i installed linux and i didnt change anything and then when i go to session/new root console it asks for a password and i put that in but im not in root, when i type login then root then my password it tells me my password is wrong but it works when installing software and everything, any help would be apreciated thanks.

wapcaplet 11-14-2003 07:21 AM

I don't think 'login' is the command you want. Try typing this in a console:

su -

(s, u, space, hyphen). Enter the root password when it asks.

szaroubi 11-14-2003 07:27 AM

try su -l

-l <== The letter L (small caps)

This will "symulate" a login.

szaroubi 11-14-2003 07:29 AM

What you can also do is check out other Terminals.
Linux is beautifull can you can run many terminals.
To access them Type; Ctrl-Alt-FX
Where X=(1->6)
And if you wana go back to xWindows the type Ctrl-Alt-F7.
Once you are in a diffrent terminal you can login as root.

jfshadow 11-14-2003 07:35 AM

Not sure what you mean that it works installing software, etc...

As a regular user you can install packages, but you can't su to root, right???

Just off the bat, I would try to boot linux up into single user mode:

[reboot]
LILO: linux 1

This will start a linux shell as user root.

Type: passwd
and enter a new password for root (twice)

Type: init 5 (to go to the graphical runlevel, or) init 3 (to enter runlevel 3 - command line with multiple users/networking, etc)

From within a console or if your at a shell prompt, type: exit

Then try to login as root with the new password you supplied. If it doesn't work, then its likely that some of the libraries or something got corrupted. You may want to look over your logs under /var/log/messages to see if an error for root login attempt occurred that may help you resolve the problem. (or just re-install :) - last resort, of course ). If it does work . . . bingo!

nick2003 11-14-2003 08:00 AM

Thanks guys, the su - and su -l worked but im now having another problem, what im trying to do is install the CrossOver plugin for quicktime, but i go into root then navigate to /home/(myusername)/Desktop and then type su then the filename and it tells me that i need to login as root. Im completly new to linux and dont know any of the commands so if someone could help me out i would apreciate it. Thanks

szaroubi 11-14-2003 08:18 AM

This is how su works (first read the manual (%>man su ) ... but I will explain)
su -l
will log you in as root and put you in root's home directory (/root)
If you want to run a command as root try:
su root -c "<insert_command_here>"
If you want to execute a command as user XYZ try
su XYZ -c "<insert command here>"

There is a trick ...
The -l switch (option) will log you in as root and change your current directory.
let say you want to know what is your current directory. you use the 'pwd' command like this:

%>pwd
/home/szaroubi/

If you do:
%>su -c "pwd"
/home/szaroubi

BUT!!!!! if you do:
%>su -l -c "pwd"
/root

THIS IS IMPORTANT ... VERY IMPORTANT
because if you do:
%>su -c "rm -rf *"
You will delete everything in the directory you are in (in example above: /home/szaroubi/*)

BUT if you do:
%>su -l -c "rm -rf *"
you will delete everything in /root ... This is wacky but know what the -l switch does.

-l will reset all your settings (well resets your environment variables) as if you just logged in as XYZ ...
without it you KEEP the same evironment variables. (If you don't nkow what envrionement variables are .. then you should read more in depth about what is found there.)

Hope this has been usefull

nick2003 11-14-2003 12:41 PM

thanks szaroubi, I cant seem to launch the file though, first i logged into root by su - then i went to the desktop where my file is and typed su root -c and tryed the filename right after that in the same line and also another su then the filename but it wont launch it, is there something im missing? i tryed typing what you said about the manual the %>man su but it doesnt launch.

szaroubi 11-14-2003 12:46 PM

You should type '%>' That was just to say "run the following command in the shell.
What type of file?
What is the error msg?
What are the permissions on the file? (to get the permissions try: 'ls -la' the -l is for List and the -a is for All ..
To change the permissions try: chmod +x <filename>
It will change the mode of the file to eXecutable.

nick2003 11-14-2003 01:45 PM

now when i try to launch it it tells me: su: user install-crossover-plugin-demo-2.0.2.sh does not exist
but when i double click it on my desktop it looks like it would install but it tells me i half to be root, is there a way i can log into root without the konsole? thanks

szaroubi 11-14-2003 02:44 PM

Do the following
su -l root
<ENTER ROOT PASSWORD>
cd <into the correct directory>
sh install-crossover-plugin-demo-2.0.2.sh

It should work ...
Did you read the README?

nick2003 11-14-2003 03:44 PM

still doesnt work :( Ive found the problem though, i have the file on my desktop in my user account but when i try to save it in the root usr folder it says i dont have access, is there anyway i can get root access outside the konsole for things like this? and where should i save it in the usr folder, i read a thread on here that said in file but i dont have that folder, im in suse 9.0. Thanks for all your help i really apreciate it.

TheOther1 11-14-2003 04:43 PM

You just want to copy it to the /root folder?

Open a terminal session, do a su - and enter root password. From the prompt, enter this:

cp /home/YOUR_USERNAME/Desktop/FILE_NAME /root and press enter.

YOUR_USERNAME = whatever you login as
FILE_NAME = the entire filename you want to copy

HTH!

nick2003 11-14-2003 05:23 PM

thanks that worked for copying it there but it still tells me im not logged in as root but i know i am because it has the #, here is exactly what happend
95-a2:~ # sh install-crossover-plugin-demo-2.0.2.sh
Verifying archive integrity...OK
Uncompressing CrossOver Plugin.............................................................................................. .................................................................................................... .................................................................................................... .................................................................................................... .................................................................................................... ................................................................

The DISPLAY variable is not set. You should either login to as root or use
the command "su" with no flags, to make sure setup has an X display to use.

nick2003 11-14-2003 05:45 PM

You guys probably think im an idiot lol, Im just so use to windows and its "one click" installing and everything that this linux is just really tuff, I did go to a couple sites and read alot of tutorials about the konsole but they dont mention installing things, Im begining to think that the problem is in the file itself though sense i was in root and it told me that. I really apreciate all your help with this you are all very helpful.


All times are GMT -5. The time now is 06:47 AM.