Author Topic: File permissions  (Read 685 times)

CaptainCool

  • Member
  • **
  • Posts: 129
  • Kudos: 0
File permissions
« on: 26 September 2002, 03:20 »
How do you change the permissions for a file  in a terminal?

smokey

  • Member
  • **
  • Posts: 183
  • Kudos: 0
File permissions
« Reply #1 on: 26 September 2002, 03:58 »
quote:
Originally posted by CaptainCool:
How do you change the permissions for a file  in a terminal?


What os are you using? In linux/unix it is chmod and in dos/windows it is attrib.
//this is how I was born :)

cat /dev/urandom > /dev/mybrain

Tip for win98 (l)users: type copy /con/con in your command prompt to increase stability


CaptainCool

  • Member
  • **
  • Posts: 129
  • Kudos: 0
File permissions
« Reply #2 on: 26 September 2002, 04:17 »
I'm usin linux.
So if I wanted to change permissions for a file called "file" would i type chmod file then the user name?

smokey

  • Member
  • **
  • Posts: 183
  • Kudos: 0
File permissions
« Reply #3 on: 26 September 2002, 04:27 »
quote:
Originally posted by CaptainCool:
I'm usin linux.
So if I wanted to change permissions for a file called "file" would i type chmod file then the user name?



yes - you type chmod whateverfileyouwant permisions.

replace permisions with the 3 letter number. to find them out I think they are in the manual for chmod so type "man chmod" to find out what permisions you want
//this is how I was born :)

cat /dev/urandom > /dev/mybrain

Tip for win98 (l)users: type copy /con/con in your command prompt to increase stability


Master of Reality

  • VIP
  • Member
  • ***
  • Posts: 4,249
  • Kudos: 177
    • http://www.bobhub.tk
File permissions
« Reply #4 on: 26 September 2002, 04:39 »
chmod *** file
you need three numbers the first is set for the owner of the file. The second is for others in the owners group and third is for EVERYONE else
the numbers:
1 = execute
2 = write
4 = read
add the number together to set whatever permsions you want. So read and write is "6". Read/write/execute is "7"

chmod 755 file is what you woul;d normally do to an executable or an unwritable directory (like a web directory).

you can also do chmod +% file
where "%" is either the letter "r", "w", or "x" this will add read, write, or executable to everyone.
Disorder | Rating
Paranoid: Moderate
Schizoid: Moderate
Linux User #283518
'It takes more than a self-inflicted gunshot wound to the head to stop Bob'

voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
File permissions
« Reply #5 on: 26 September 2002, 05:45 »
Use "chown" to change ownership of the file, use "chmod" to change file permissions based on that owner and group. I wrote a few quite long messages about file permissions somewhere around here quite a while back. Might want to search the "Linux/UNIX" forum for them.  Otherwise do a "man chmod" and "man chown" to see the local documentation. There are bazillions of web sites with better tutorials/instructions. Just type in "chmod" and "chown" in google and you'll have plenty of info.

[ September 25, 2002: Message edited by: void main ]

Someone please remove this account. Thanks...

Stryker

  • VIP
  • Member
  • ***
  • Posts: 1,258
  • Kudos: 41
File permissions
« Reply #6 on: 26 September 2002, 07:42 »
I prefer chmod (a/g/u)+-(r/w/x) filename
so for executables...
chmod a+rx index.cgi


but that's just me, it will be longer if you want to be really specific on who gets what.

sporkme

  • Member
  • **
  • Posts: 501
  • Kudos: 149
    • http://sporkme.net/
File permissions
« Reply #7 on: 26 September 2002, 10:38 »
its just like ftp

777 lets anyone do anything

chmod 777 filename

chmod 766 filename

and such

there is little to understand, really...  jack with it.
just that you do not take an interest in politics does not mean that politics will not take an interest in you.  -pericles 430 b.c.