LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   unable to change file permissions (https://www.linuxquestions.org/questions/linux-newbie-8/unable-to-change-file-permissions-4175515417/)

Bhanu999 08-18-2014 10:38 PM

unable to change file permissions
 
Hi, I'm using Debian 7.6 with xfce desktop.
I want to encrypt a folder so that other users cant view it.

I tried by using the following command

# chmod go-rwx foldername

but it's not working.
Is the command wrong ? what should I do to encrypt the folder, please help me.

Ztcoracat 08-18-2014 10:56 PM

Quote:

Originally Posted by Bhanu999 (Post 5223450)
Hi, I'm using Debian 7.6 with xfce desktop.
I want to encrypt a folder so that other users cant view it.

I tried by using the following command

# chmod go-rwx foldername

but it's not working.
Is the command wrong ? what should I do to encrypt the folder, please help me.


Cryptkeeper is an encrypted folders manager, it allows to mount and umount, to create new folders, to change the password of each mount.

Try here:
http://ostechnix.wordpress.com/2013/...buntu-distros/

ondoho 08-19-2014 02:48 AM

Quote:

Originally Posted by Bhanu999 (Post 5223450)
# chmod go-rwx foldername

what does this command do? why do you think it's the right way to do it? can you document that?

basically, it should be really easy to achieve what you want with chmod (or from your file manager).

Ztcoracat 08-19-2014 03:00 PM

After reading the man page for "chmod" I didn't find "go" mentioned in the "Options" section.

However; I did find on this page chmod go-
Code:

Make a file readable and writable by the group and others:
chmod go+rw file

http://ss64.com/bash/chmod.html

But chmod with "go" only provides read and write permissions.


Quote:

basically, it should be really easy to achieve what you want with chmod (or from your file manager).
I agree; ondoho: otherwise if OP doesn't want other users to have permissions, simply only allow them read only or make it so that only the "root" or 'Owner' has access to that particular folder:-

astrogeek 08-19-2014 03:27 PM

Quote:

Originally Posted by Ztcoracat (Post 5223771)
After reading the man page for "chmod" I didn't find "go" mentioned in the "Options" section...

For those of us who spoke octal and hex before stumbling across the symbolic syntax, this can look a little obscure, but from the chmod man page...

Quote:

The format of a symbolic mode is [ugoa...][[+-=][perms...]...], where perms is either zero
or more letters from the set rwxXst, or a single letter from the set ugo. Multiple symbolic
modes can be given, separated by commas.

A combination of the letters ugoa controls which users' access to the file will be changed:
the user who owns it (u), other users in the file's group (g), other users not in the file's
group (o), or all users (a). If none of these are given, the effect is as if a were given,
but bits that are set in the umask are not affected.

The operator + causes the selected file mode bits to be added to the existing file mode bits
of each file; - causes them to be removed; and = causes them to be added and causes unmen-
tioned bits to be removed except that a directory's unmentioned set user and group ID bits
are not affected.

The letters rwxXst select file mode bits for the affected users: read (r), write (w), exe-
cute (or search for directories) (x), execute/search only if the file is a directory or
already has execute permission for some user (X), set user or group ID on execution (s),
restricted deletion flag or sticky bit (t).
So chmod go-rw simply unsets the read and write bits for group and other users, equivalent to chmod 700 (assuming owner all perms and none for anyone else).

It should also be noted that the x bit serves a different purpose on directories than on files. On directories it allows/prevents the given user from traversing or crossing (i.e. searching) into or beyond the directory, whereas on a file it is used as the executable bit. So for the OPs purposes, if I read it correctly, they may want to only set go-rw(x) on the specific files within a directory, but not on the directory itself as that might have unintended consequences.

Ztcoracat 08-19-2014 03:44 PM

Thanks astrogeek!

I somehow missed this part-
Code:

So chmod go-rw simply "unsets" the read and write bits

Bhanu999 08-22-2014 09:14 AM

got it
 
OK i got it thank you for all..

Ztcoracat 08-22-2014 01:26 PM

Your Welcome-Bhanu999

Have a good weekend!


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