Problem with su -

jdow jdow at earthlink.net
Tue Mar 6 15:31:30 UTC 2012


On 2012/03/06 04:45, Bob Goodwin wrote:
> On 06/03/12 07:03, suvayu ali wrote:
>> On Tue, Mar 6, 2012 at 12:30, Ed Greshko<Ed.Greshko at greshko.com> wrote:
>>> You said you have this....
>>>
>>> bash-4.2# ls /etc/bashrc*
>>> /etc/bashrc /etc/bashrc~ /etc/bashrc.wrkng
>>>
>>> I don't know what /etc/bashrc~ since I don't have one on my system.
>>> Maybe move that to /tmp or something and try again?
>>>
>> Those are backup files from some editor, most likely emacs. It suggests
>> the OP has edited the /etc/bashrc at some point in the past.
>>
>>> I also note that "ll" doesn't seem to work. That is also troublesome
>>> since it would seem to indicate a problem with sourcing the files in
>>> /etc/profile.d. You do have a /etc/profile file?
>>>
>>> Another thing to try....
>>>
>>> Move /etc/bashrc.wrkng back to /etc/bashrc and then "su -". You'll have
>>> the "bad" prompt. But then type ". /etc/bashrc" and see if there are
>>> any error messages.
>> I think all these problems are still related to the SELinux issue the OP
>> had earlier. Probably the relabel did not work completely. I would
>> suggest the OP to take a look at the permissions and the SELinux context
>> of the profile directories and rc files.
>>
>> This is how it should be:
>>
>> $ ls -lhd /etc/bash* /etc/profile*
>> -rw-r--r--. 1 root root 57K Sep 4 2011 /etc/bash_completion
>> drwxr-xr-x. 2 root root 4.0K Feb 28 14:30 /etc/bash_completion.d
>> -rw-r--r--. 1 root root 2.6K Aug 16 2011 /etc/bashrc
>> -rw-r--r--. 1 root root 1.8K Aug 16 2011 /etc/profile
>> drwxr-xr-x. 2 root root 4.0K Feb 27 10:09 /etc/profile.d
>
> [root at box9 ~]# ls -lhd /etc/bash* /etc/profile*
> -rw-r--r--. 1 root root 57K Sep 4 2011 /etc/bash_completion
> drwxr-xr-x. 2 root root 4.0K Feb 3 10:35 /etc/bash_completion.d
> -rw-r--r--. 1 root root 2.6K Mar 6 07:10 /etc/bashrc
> -rw-r--r--. 1 root root 2.6K Aug 16 2011 /etc/bashrc~
> -rw-r--r--. 1 root root 2.6K Mar 6 05:30 /etc/bashrc.wrkng
> -rw-r--r--. 1 root root 1.8K Aug 16 2011 /etc/profile
> drwxr-xr-x. 2 root root 4.0K Mar 3 12:09 /etc/profile.d
>
>
>>
>>
>> $ ls -Zd /etc/bash* /etc/profile*
>> -rw-r--r--. root root system_u:object_r:etc_t:s0 /etc/bash_completion
>> drwxr-xr-x. root root system_u:object_r:etc_t:s0 /etc/bash_completion.d
>> -rw-r--r--. root root system_u:object_r:etc_t:s0 /etc/bashrc
>> -rw-r--r--. root root system_u:object_r:etc_t:s0 /etc/profile
>> drwxr-xr-x. root root system_u:object_r:bin_t:s0 /etc/profile.d
>
> [root at box9 ~]# ls -Zd /etc/bash* /etc/profile*
> -rw-r--r--. root root system_u:object_r:etc_t:s0 /etc/bash_completion
> drwxr-xr-x. root root system_u:object_r:etc_t:s0 /etc/bash_completion.d
> -rw-r--r--. root root unconfined_u:object_r:etc_t:s0 /etc/bashrc
> -rw-r--r--. root root system_u:object_r:etc_t:s0 /etc/bashrc~
> -rw-r--r--. root root unconfined_u:object_r:etc_t:s0 /etc/bashrc.wrkng
> -rw-r--r--. root root system_u:object_r:etc_t:s0 /etc/profile
> drwxr-xr-x. root root system_u:object_r:bin_t:s0 /etc/profile.d
>
>
>>
>> # ls -lh /root/.bash*
>> -rw-------. 1 root root 32K Mar 4 22:55 /root/.bash_history
>> -rw-r--r--. 1 root root 24 Aug 10 2011 /root/.bash_logout
>> -rw-r--r--. 1 root root 404 Feb 19 18:11 /root/.bash_profile
>> -rw-r--r--. 1 root root 2.1K Mar 4 22:57 /root/.bashrc
>
> [root at box9 ~]# ls -lh /root/.bash*
> -rw-------. 1 root root 927 Mar 6 07:13 /root/.bash_history
>
>
>>
>> # ls -Z /root/.bash*
>> -rw-------. root root system_u:object_r:admin_home_t:s0 /root/.bash_history
>> -rw-r--r--. root root system_u:object_r:admin_home_t:s0 /root/.bash_logout
>> -rw-r--r--. root root system_u:object_r:admin_home_t:s0 /root/.bash_profile
>> -rw-r--r--. root root system_u:object_r:admin_home_t:s0 /root/.bashrc
>
> [root at box9 ~]# ls -Z /root/.bash*
> -rw-------. root root system_u:object_r:admin_home_t:s0
> /root/.bash_history
>
>
>>
>> GL
>>
>
> All I've done here is listed the files you suggested, not sure what
> the results mean ...
>
> Bob

You have cleared out your root directory is that that means. Whatever was
in there is lost. You played with the "rm" command as root and were
careless about the command formatting. "Oops".

Repair will be tedious at best - reinstall at worst depending on your level
of expertise.

{^_^}


More information about the users mailing list