Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
|
07-17-2003, 02:45 AM
|
#16
|
Senior Member
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,637
Rep:
|
Quote:
Originally posted by MasterC
Umask ...
Happy Birthday ItsJustMe!
|
Same from me, better late than never ... and have a good new year.
|
|
|
07-19-2003, 12:33 PM
|
#17
|
Member
Registered: Jul 2003
Posts: 34
Rep:
|
Hi,
One more question here...
Since default file permission is 666, how can I make the file to have rwx permission?
|
|
|
07-19-2003, 02:55 PM
|
#18
|
Senior Member
Registered: Mar 2003
Location: Earth
Distribution: Slackware, Ubuntu, Smoothwall
Posts: 1,571
Rep:
|
Well, if you mean:
rwx------ then just 'chmod 700 file'.
666 = rw-rw-rw-
If you mean you want all the permission bits turned on, then:
chmod 777 file will give you rwxrwxrwx.
Each 3 position permission 'field', rwx, is represented by just one of the digits in 666.
If you mean you want to set umask such that a newly created file is defaulted to rwx------, then.. uh... I'd have to look into that. But, I don't think you want to have that as a default.
|
|
|
07-19-2003, 03:37 PM
|
#19
|
Member
Registered: Jul 2003
Posts: 34
Rep:
|
Hi,
Sorry for not indicating clearly my query.
What I'm mean is that since the default file permission is 666, and umask is 022. Even if I change umask to 000, permission set for creating new file is still 666. In that case, how can I make the file to be executable once a new file is created? having permission 7?
|
|
|
07-19-2003, 03:58 PM
|
#20
|
Senior Member
Registered: Mar 2003
Location: Earth
Distribution: Slackware, Ubuntu, Smoothwall
Posts: 1,571
Rep:
|
Well, that's just something you have to figure out on a case by case basis depending on who you want to be allowed to execute the file. You have to come up with whatever it takes to get the x bit set for owner, group, or others.
There are some other options, using u g and o, for setting the permissions, but I haven't gotten around to looking into those yet.
Go back and look at that link to that Introduction to Linux.
You coud aslo cut and paste in here the ls -l output for your file and then the rwxrwxrwx combination you want and we can work from there maybe.
|
|
|
07-20-2003, 12:10 AM
|
#21
|
LQ Guru
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613
Rep:
|
7 is not the execute bit, 7 is the "all" bit. You don't need the "all" bit to execute, you only need execute:
chmod 100
When dealing with permissions you want to set the lowest amount possible to attain your goal. Giving 7 permissions on every file just to execute it is a failure on one's security precautions.
Permissions are there for a reason
As for how your umask of 022 is setting 666 permissions, that's likely happening somewhere else on the system. Look at your /etc/profile and each users bash_profile and bashrc to see if you find any umask=111 (chmod 666). If you are placing these files into a fat32 partition, you will need to look at the umask of the mounting partition. This is more likely your problem(case) than elsewhere. Setting a noexec on a non-linux partition is a security measure again. If you are not the admin of the box, then speak with the administrator to see if they have done something to set a no-exec bit on all files on a given partition/set of files (/etc/profile /etc/fstab and bashrc/bash_profile are a few places to check).
HTH
Cool
|
|
|
All times are GMT -5. The time now is 07:33 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|