Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am using cent OS Operating system without GNOME.

In the starting, it asks

localhost login:
Password:

It has one user named service under group name service whose password is also service.

I want to enter in OS by this user named service.

When I do this, it shows this lines

Last Login: Mon Feb 18 16:16:26 on tty1
-bash: /home/service/.bashrc: Permission denied
-bash-3.2$

I changed in /etc/sudoers, and add service ALL=(ALL) ALL, right below root ALL=(ALL) ALL, but it didn't work.

when I try to switch from root to service, it shows the same error.

EDITED

When I run ls -a -l | grep .bashrc, it shows

lrwxrwxrwx 1 root  root   41 Feb 18 11:40 .bashrc -> /home/service/etc/version.symlink/.bashrc
-rw-r--r-- 1 service service 124 Feb 15 13:06 .bashrc-moved-1361167832

Help me. Looking for your kind response.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Your login as user 'service' seems to be successful. On login, the Bash shell will be loaded, which by default executes ~/.bashrc. But in your case there seems to be something strange with your ~/.bashrc. You also seem to have a file called '.bashrc-moved-1361167832'.

Now I don't know how this happened, but something seems to have moved your original .bashrc away, and replaced it with a link to a file that you can't execute.

I have no idea what has done this and why, but if you want to get rid of it then you could do this as user 'service' in your home dir ~:

sudo rm .bashrc
mv .bashrc-moved-1361167832 .bashrc

This will first remove the link to this alternative file. And then (I guess) restore the original.

Now try to relogin.

share|improve this answer
    
I remove the .bashrc-moved-1361167832.sh because that is useless. Now tell me how to change the ownership, and this is symlink, see the first line of output of ls.. command –  devnull Feb 18 '13 at 11:56
    
What I ment was the following. I guessed that .bashrc-moved-1361167832.sh was your original .bashrc, until something has renamed it. Thats why I suggested you would restore it. To change ownership you have to use chown, but I'm not sure if this will help you. You may try doing chown service ~/.bashrc and see if that helps. –  mauro.stettler Feb 18 '13 at 11:58
    
I resolved this problem , by creating .bashrc in service user, then copy content of above file, then remove above file. This problem resolved. Thanks a lot for taking time for me. –  devnull Feb 18 '13 at 13:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.