LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Change permission inquire. (https://www.linuxquestions.org/questions/linux-newbie-8/change-permission-inquire-860469/)

MODYSAMA 02-03-2011 08:20 AM

Change permission inquire.
 
Quote:

sok@sok-HP-ProBook-4520s:/etc/modprobe.d$ sudo chmod +x modprobe.d
chmod: cannot access `modprobe.d': No such file or directory
sok@sok-HP-ProBook-4520s:/etc/modprobe.d$ cat> new.conf
bash: new.conf: Permission denied
I tried it with sudo and without it.
Excuse me, What the wrong I do!?

druuna 02-03-2011 08:25 AM

Hi,

Sudo might not be aware of where you are standing when you execute the chmod command.

Try: sudo chmod +x /etc/modprobe.d


You are standing in the wrong directory..... You are in /etc/modprobe.d and try to chmod modprobe.d. You need to be in /etc.

Hope this helps.

crts 02-03-2011 08:25 AM

Since you are already in modprobe.d your command does not see the modprobe.d folder.
Try
sudo chmod +x .
or
sudo chmod +x ../modprobe.d

[Edit]
Or give full path as suggested by druuna

tronayne 02-03-2011 08:35 AM

It looks like you're in /etc/modprobe.d; simply
Code:

cd /etc
chmod +x modprobe.d

By the way, /etc/modprobe.d is, by default
Code:

drwxr-xr-x  2 root root    4096 2010-07-01 10:10 modprobe.d/
So, adding execute permission would have no effect; and the conf file that are in it (yours may vary) are
Code:

drwxr-xr-x  2 root root  4096 2010-07-01 10:10 ./
drwxr-xr-x 81 root root 12288 2011-02-02 15:38 ../
-rw-r--r--  1 root root  131 2010-04-27 17:47 BLACKLIST-nouveau.conf
-rw-r--r--  1 root root  6251 2009-08-14 10:06 blacklist.conf
-rw-r--r--  1 root root  128 2010-05-02 04:11 bluetooth.conf
-rw-r--r--  1 root root  177 2010-07-01 10:10 dgc
-rw-r--r--  1 root root    0 2010-07-01 10:10 dgc.conflicts
-rw-r--r--  1 root root  443 2009-05-29 21:25 isapnp.conf
-rw-r--r--  1 root root  265 2009-08-14 10:04 psmouse.conf
-rw-r--r--  1 root root    64 2010-06-29 13:47 sound
-rw-r--r--  1 root root  244 2009-05-29 21:25 usb-controller.conf

You may not want to mess with them unless you know exactly what you're doing and why, eh?

Essentially, if you want to change the permission mask on a file or directory, you either need to be one directory level above (so you can ls -l name-of-file-or-directory), use absolute path, or use relative path; e.g., in the directory use the "dot-dot;" e.g., in /etc/modprobe.d you can ls ../modprobe.d (or chmod or whatever).

Hope this helps some.

MODYSAMA 02-03-2011 09:14 AM

Many thank for all.
still have the problem.

Quote:

sok@sok-HP-ProBook-4520s:~$ cd /etc
sok@sok-HP-ProBook-4520s:/etc$ chmod +x modprobe.d
chmod: changing permissions of `modprobe.d': Operation not permitted
Quote:

sok@sok-HP-ProBook-4520s:/etc$ sudo chmod +x modprobe.d
sok@sok-HP-ProBook-4520s:/etc$ cd modprobe.d
sok@sok-HP-ProBook-4520s:/etc/modprobe.d$ cat> x.conf
bash: x.conf: Permission denied
I only can create while booting (2.6.35-22 generic (recovered) and prompt root shell ).
please need to do it throught inside Kubuntu.

crts 02-03-2011 09:30 AM

Quote:

Originally Posted by MODYSAMA (Post 4247173)
Many thank for all.
still have the problem.

I only can create while booting (2.6.35-22 generic (recovered) and prompt root shell ).
please need to do it throught inside Kubuntu.

You are trying to create a file as a normal user. You do not have this permission. Try
sudo cat > x.conf

instead. CAREFUL: If you already have a file called x.conf in that folder then it will be truncated and all data it contains will be lost!
Maybe you should elaborate on what you are actually trying to achieve. Then maybe we can provide some more effective advice.

MODYSAMA 02-03-2011 09:44 AM

I tried it.. but
Quote:

sok@sok-HP-ProBook-4520s:/etc$ sudo chmod +x modprobe.d
sok@sok-HP-ProBook-4520s:/etc$ cd modprobe.d
sok@sok-HP-ProBook-4520s:/etc/modprobe.d$ sudo cat> x.conf
bash: x.conf: Permission denied

crts 02-03-2011 10:05 AM

Quote:

Originally Posted by MODYSAMA (Post 4247200)
I tried it.. but

My bad. Try
sudo -s 'cat > x.conf'

from within /etc/modprobe.d

MODYSAMA 02-03-2011 10:24 AM

Crts really many thanks for being helpful.
Quote:

sudo -s 'cat > x.conf'
it works thanks my ALLAH.


All times are GMT -5. The time now is 08:17 PM.