LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-18-2014, 10:38 PM   #1
Bhanu999
LQ Newbie
 
Registered: Jun 2013
Location: India
Posts: 27

Rep: Reputation: Disabled
Unhappy 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.
 
Old 08-18-2014, 10:56 PM   #2
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware
Posts: 7,451
Blog Entries: 10

Rep: Reputation: Disabled
Quote:
Originally Posted by Bhanu999 View Post
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/
 
Old 08-19-2014, 02:48 AM   #3
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 5,802

Rep: Reputation: 1379Reputation: 1379Reputation: 1379Reputation: 1379Reputation: 1379Reputation: 1379Reputation: 1379Reputation: 1379Reputation: 1379Reputation: 1379
Quote:
Originally Posted by Bhanu999 View Post
# 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).
 
Old 08-19-2014, 03:00 PM   #4
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware
Posts: 7,451
Blog Entries: 10

Rep: Reputation: Disabled
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:-
 
Old 08-19-2014, 03:27 PM   #5
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=14, FreeBSD_10{.0|.1|.2}
Posts: 4,259
Blog Entries: 1

Rep: Reputation: 2291Reputation: 2291Reputation: 2291Reputation: 2291Reputation: 2291Reputation: 2291Reputation: 2291Reputation: 2291Reputation: 2291Reputation: 2291Reputation: 2291
Quote:
Originally Posted by Ztcoracat View Post
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.

Last edited by astrogeek; 08-19-2014 at 03:39 PM. Reason: tpos, typs, typos...
 
Old 08-19-2014, 03:44 PM   #6
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware
Posts: 7,451
Blog Entries: 10

Rep: Reputation: Disabled
Thanks astrogeek!

I somehow missed this part-
Code:
So chmod go-rw simply "unsets" the read and write bits
 
Old 08-22-2014, 09:14 AM   #7
Bhanu999
LQ Newbie
 
Registered: Jun 2013
Location: India
Posts: 27

Original Poster
Rep: Reputation: Disabled
Smile got it

OK i got it thank you for all..
 
Old 08-22-2014, 01:26 PM   #8
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware
Posts: 7,451
Blog Entries: 10

Rep: Reputation: Disabled
Your Welcome-Bhanu999

Have a good weekend!
 
  


Reply

Tags
encrypt, file


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How can I change file permissions in windows ntfs partition.Even root can't change it e3399 Linux - Newbie 3 03-02-2011 10:54 PM
Unable to change file permissions to execute azm882 Linux - General 2 06-17-2010 09:47 AM
unable to change file permissions!! dcdbutler Linux - General 11 02-06-2005 09:58 AM
file permissions and file owner won't change Nadim Slackware 5 11-29-2003 06:03 PM
suddenly unable to change permissions (very strange) hobylinux Linux - Hardware 5 09-15-2003 06:30 PM


All times are GMT -5. The time now is 01:22 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration