-   Slackware (
-   -   Can't cd to a directory (

thirteen_engines 04-19-2013 12:30 PM

Can't cd to a directory
I have a weird little problem, the solution of which is eluding me.

I have a database on my office machine that is accessed by logging in as a special user. The user's default 'shell' is the database program and therefore is all the user sees upon login. Each year I update the program and database ... this year in March. Everything was ok then but not now.

When I log in as user "csd" I get:

bash: /usr/src/cambridge/.bashrc: Permission denied

This is csd's home folder. The permissions for the folder are:

drwxr-xr-x 18 csd users 4096 Mar 7 14:39 cambridge/

When I temporarily change csd's shell to bash I find that I cannot cd to this folder. Why would that be if csd owns it? BTW, folder cambridge/ is in /usr/src (because it's located on a large drive). There have been no such problems in the past. Everything was working in March.

If I change csd's home folder to /home/csd but leave the 'shell' program in cambridge/bin it still doesn't work. If I copy the entire cambridge/ folder to /home/csd I can then begin to run the program ... but I don't want to do that. I'd rather leave it on the large drive. There are other problems associated with moving it as well.

Colour me puzzled. :)

tuxbg 04-19-2013 12:40 PM

And what is the permissions of .bashrc ?

thirteen_engines 04-19-2013 01:21 PM

There's no .bashrc file .. that's part of the mystery.

Richard Cranium 04-19-2013 10:15 PM

Please post the output of the command

grep csd /etc/passwd
What happens when you log in as root first, issue the command "su csd", and then attempt to cd into /usr/src/cambridge?

thirteen_engines 04-20-2013 10:20 AM

Here's the output of "grep csd /etc/passwd":


Logging in as root and then su'ing to csd gives:

bash: /usr/src/cambridge/.bashrc: Permission denied

What I don't understand is that I've set the permissions of /usr/src/cambridge so that csd owns it and all of it's sub-directories. This approach has worked for years but seems to have suddenly changed.

thirteen_engines 04-20-2013 10:28 AM

Found what was causing the problem!!

/usr/src had permissions 700 ... only root could cd there. Everything is good now. Thanks for the replies. :)

All times are GMT -5. The time now is 10:15 PM.