LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   how is it that su - can be denied permission??? (https://www.linuxquestions.org/questions/linux-general-1/how-is-it-that-su-can-be-denied-permission-161614/)

Lleb_KCir 03-23-2004 10:23 PM

how is it that su - can be denied permission???
 
[ray@localhost xxxxx]$ su -
Password:
[root@localhost ~]# ./ vncserver
./: Permission denied.
[root@localhost ~]#


am i wrong in my understanding of the root permisions, but dont they have full 100% access to everything in a linux box?


how in the world am i being denied permission as the su?

DavidPhillips 03-23-2004 10:38 PM

the file still needs to be executable to run like that.


chmod 755 vncserver
./vncserver

Lleb_KCir 03-23-2004 10:42 PM

what is 755 in the chmod?

i am familure with chmod +x to make things executable, but what is the 755.


oh and found out i could run it if i navigated to the dir and just typed in vncserver without the ,/, but was under the impression that the ./ ment i could run it from what ever dir. i was currently in. is that wrong?

Brane Ded 03-23-2004 11:11 PM

Quote:

Originally posted by Lleb_KCir
what is 755 in the chmod?

i am familure with chmod +x to make things executable, but what is the 755.


oh and found out i could run it if i navigated to the dir and just typed in vncserver without the ,/, but was under the impression that the ./ ment i could run it from what ever dir. i was currently in. is that wrong?

The './' part tells it to run an executable file in the directory you're currently in. If you're not in that directory, you have to type out the full path, unless the file is in a directory in your system path. If you can execute it without the './,' that should mean it's in your path.

To confirm this, type:
# which vncserver

itsjustme 03-23-2004 11:30 PM

Quote:

Originally posted by Lleb_KCir
what is 755 in the chmod?

i am familure with chmod +x to make things executable, but what is the 755.

Check this out:

http://www.linuxquestions.org/questi...hmod+itsjustme

Lleb_KCir 03-23-2004 11:39 PM

Calculating a Mode.
Owner Group Others
rwx rwx rwx
400 200 100 40 20 10 4 2 1
_
Simply add up the numbers corresponding to the individual permission you want.
If you want a permission of "rw-r--r--", you add: 400 + 200 + 40 + 4 = 644
Then at the command line, you must use the "chmod" command like this:
chmod 644 filename

thank you very much. so 755 would be rwx-rx-rx or something like that, but basicaly gives owner full permissions, and group, other read and execute.

[edit] copy/paste did not work real well. edit again to note that this forum dose not keep spacing in post when it publishes the reply. there should be spacing enough between Owner, group, others to spread out the #s a little better.

Brane Ded 03-23-2004 11:58 PM

Use the code flags if you want to preserve the spacing.

Shade 03-24-2004 12:11 AM

The problem with your original command was the space between ./ and vncserver.

--Shade

SciYro 03-24-2004 02:46 AM

chmod except numbers too, (something i would like to see "ls -l" do, as the letters are all too long and i hate reading :))

something like "chmod 1755", but "chmod 0755" works to

DavidPhillips 03-24-2004 11:31 PM

if you in /usr/bin and there is a file there named vncserver then these would work


/usr/bin/vncserver
./vncserver

or since it's most likely in your path then this would work

vncserver



And yes, that an excellent point about the space there. I did not even see that.

All you are doing is giving a path/filename ---

. is the current path / is the seperator

Lleb_KCir 03-24-2004 11:47 PM

DavidPhillips thank you for the detailed explanation. now not only do i know how, but i know why. very important.


All times are GMT -5. The time now is 12:40 AM.