csh: permission denied
When i use 'csh' to execute any c shell script, the command line console always prompt "/home/xxx: Permission denied" message.
but the shell script works ok when i use 'sh' to execute it. So i think it has not relation with the permission of shell script. lrwxrwxrwx 1 root root 4 Apr 9 22:23 /bin/sh -> bash lrwxrwxrwx 1 root root 4 Apr 9 22:25 /bin/csh -> tcsh -rwxr-xr-x 1 root root 616248 Oct 6 2006 /bin/bash -rwxrwxrwx 1 root root 307488 Mar 15 2007 /bin/tcsh |
Set the execute permission on the script:
# chmod +x script_name Then run: # ./script_name |
Thanks for your reply.
My problem is not relation with the permission of shell script which executed by csh. it is about the permission of csh command. When i just type "csh" in command line console, the console prompt "permission denied" like below. [jjguo@stsdd08-4 /]$ csh /home/jjguo: Permission denied. And it can work but it always prompt "Permission denied" message, i just don't know why this happens. |
The group and other permissions for tcsh should not have the write permissions. Reinstall tcsh. Determine how it happened. I'm somewhat worried that the command was replaced with a cracker's version, in which case, tcsh is the least of your worries. Check if tcsh is a wrapper script for some reason.
|
Quote:
P.S. Read here: http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/ |
Hi.
Please post the shortest example of a script that exhibits this behavior along with a copy / paste of the output, and the similar output as executed with sh. Otherwise we're working just where the light is good, not where the problem is. I'm betting on something in .cshrc or .tcshrc ... cheers, makyo |
you don't need to care about whatever shell script it executes, for example:
[jjguo@stsdd08-4 ~]$ csh /home/jjguo: Permission denied. [jjguo@stsdd08-4 ~]$ sh sh-3.00$ Simultaneity, csh can execute shell script correctly, but just always prompt the message "Permission denied". thanks |
I have commented all codes in .cshrc file, it still prompt "Permission denied"
thanks. |
i found that when i switch to another user, csh don't prompt that message.
Maybe it is related with my user. the two user's information in file /etc/passwd aime:x:94110:42424::/scratch/aime:/bin/tcsh jjguo:70dQGjUwdngPM:505540:8500::/home/jjguo:/bin/csh the first user 'aime' is ok the second user 'jjguo' is wrong [aime@stsdd08-4 ~]$ csh [aime@stsdd08-4 ~]$ [jjguo@stsdd08-4 aime]$ csh /home/jjguo: Permission denied. [jjguo@stsdd08-4 aime]$ thanks everyone. |
What is the output of the following command:
Code:
ls -ld /home/jjguo /home//home/jjguo/.??* |
[jjguo@stsdd08-4 ~]$ ls -ld /home/jjguo /home /home/jjguo/.??*
drwxr-xr-x 11 root root 4096 Sep 4 09:48 /home drwxr-xr-x 21 jjguo 645 4096 Sep 16 07:08 /home/jjguo -rw------- 1 jjguo dba 56 Sep 16 03:55 /home/jjguo/.bash_history -rw-r--r-- 1 jjguo dba 118 Sep 11 07:20 /home/jjguo/.bashrc drwxr-xr-x 3 jjguo dba 4096 Sep 9 02:17 /home/jjguo/.config -rw-r--r-- 1 jjguo dba 152 Sep 15 19:00 /home/jjguo/.cshrc drwxr-x--- 2 jjguo dba 4096 Sep 9 02:17 /home/jjguo/.eggcups drwx------ 4 jjguo dba 4096 Sep 11 01:48 /home/jjguo/.gconf drwx------ 2 jjguo dba 4096 Sep 16 00:37 /home/jjguo/.gconfd drwx------ 4 jjguo dba 4096 Sep 9 09:18 /home/jjguo/.gnome drwx------ 7 jjguo dba 4096 Sep 9 02:17 /home/jjguo/.gnome2 drwx------ 2 jjguo dba 4096 Sep 9 02:17 /home/jjguo/.gnome2_private drwxr-xr-x 2 jjguo dba 4096 Sep 9 02:17 /home/jjguo/.gstreamer-0.8 -rw-r--r-- 1 jjguo dba 136 Sep 9 02:17 /home/jjguo/.gtkrc-1.2-gnome2 -rw------- 1 jjguo dba 497 Sep 11 01:47 /home/jjguo/.ICEauthority drwxrwxr-x 3 jjguo dba 4096 Sep 16 00:38 /home/jjguo/.java drwx------ 3 jjguo dba 4096 Sep 9 02:17 /home/jjguo/.metacity drwx------ 3 jjguo dba 4096 Sep 10 01:55 /home/jjguo/.mozilla drwxr-xr-x 3 jjguo dba 4096 Sep 9 02:17 /home/jjguo/.nautilus -rw------- 1 jjguo dba 0 Sep 9 02:17 /home/jjguo/.recently-used -rw------- 1 jjguo dba 574 Sep 14 01:48 /home/jjguo/.rhn-applet.conf drwx------ 2 jjguo dba 4096 Sep 11 22:34 /home/jjguo/.ssh -rw------- 1 jjguo dba 10033 Sep 16 07:08 /home/jjguo/.viminfo -rw-r--r-- 1 jjguo dba 0 Sep 10 03:55 /home/jjguo/.viminfo.tmp drwxr-xr-x 2 jjguo dba 4096 Sep 16 07:08 /home/jjguo/.vnc -rw------- 1 jjguo dba 517 Sep 16 00:23 /home/jjguo/.Xauthority |
/home/jjguo should be group dba (or whatever group your jjguo belongs do).
Code:
sudo chgrp dba /home/jjguo Code:
cat ~jjguo /.cshrc |
Quote:
Code:
[jjguo@stsdd08-4 ~]$ cat .cshrc |
Quote:
In case you're interested, the ~ character is a shortcut equivalent of your home directory. You are trying to execute your home directory as a command, just as if you did: Code:
$ /home/jjguo |
Quote:
You are right, the problem is fixed. Thank you very much. This problem results from my mistake. Thank everyone who cares about this question. |
All times are GMT -5. The time now is 12:57 PM. |