Ask Your Question

Problem with bash in fedora 18

asked 2013-06-14 14:01:43 -0600

c00per gravatar image

updated 2013-06-14 21:54:41 -0600

FranciscoD_ gravatar image

I switched from Ubuntu to fedora two months ago.Everything was fine until in last two or three days I'm start facing a series of problems .

  1. whenever I tries to switch from normal user through su -l - or su -l i"m getting -bash-4.2# instead of [root@cooper ~]#.

  2. whenever I tries to switch in superuser mode through sudo -i the terminal directly gives me -bash-4.2#, without asking a password.

    3.The root user is unable to change the permission on any file even created by the normal users.It shows permission denied whenever I tries to run any scripts created by the normal user.

I tried to move the content of /etc/skel to bashrc of root but nothing happens.

edit retag flag offensive close merge delete


Try using ^ALT-F2 to switch to a text console and log in there as root. Whether that works better or not, it should tell us something.

sideburns gravatar imagesideburns ( 2013-06-14 14:51:36 -0600 )edit

same problem in the case of ^ALT-F2 i.e a text console .

c00per gravatar imagec00per ( 2013-06-14 15:03:09 -0600 )edit

I just noticed that you refer to root's bashrc, not .bashrc. The two names aren't the same, and if you've removed that dot by accident, that may be what's causing your difficulties.

sideburns gravatar imagesideburns ( 2013-06-15 15:13:22 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2013-06-14 15:53:34 -0600

fragmentally gravatar image

updated 2013-06-14 15:56:19 -0600

Switch to root via "su -l" or "sudo su -l"

When you get the prompt, type:
whoami <enter>

It should respond with "root".

echo $HOME

It should be "/root"

cd $HOME
ls -la

You should see files like ".bash_profile", ".bash_profile", etc.

If not, cat your /etc/password file and paste just the "root" line here.

It appears something stomped your /root directory.

edit flag offensive delete link more


Even easier is simply to run "su -" without the quotes, then pwd, to tell you your current working directory, which should be /root. (With su, using - by itself implies -i so that su - logs you in as root.) Once you're in /root as root, follow fragmentally's instructions.

sideburns gravatar imagesideburns ( 2013-06-14 18:13:49 -0600 )edit

Question Tools


Asked: 2013-06-14 14:01:43 -0600

Seen: 835 times

Last updated: Jun 14 '13