LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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


Reply
  Search this Thread
Old 07-17-2003, 01:45 AM   #16
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,634

Rep: Reputation: Disabled

Quote:
Originally posted by MasterC
Umask ...
Happy Birthday ItsJustMe!
Same from me, better late than never ... and have a good new year.
 
Old 07-19-2003, 11:33 AM   #17
lido
Member
 
Registered: Jul 2003
Posts: 34

Rep: Reputation: 15
Talking

Hi,

One more question here...


Since default file permission is 666, how can I make the file to have rwx permission?
 
Old 07-19-2003, 01:55 PM   #18
itsjustme
Senior Member
 
Registered: Mar 2003
Location: Earth
Distribution: Slackware, Ubuntu, Smoothwall
Posts: 1,571

Rep: Reputation: 47
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.
 
Old 07-19-2003, 02:37 PM   #19
lido
Member
 
Registered: Jul 2003
Posts: 34

Rep: Reputation: 15
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?
 
Old 07-19-2003, 02:58 PM   #20
itsjustme
Senior Member
 
Registered: Mar 2003
Location: Earth
Distribution: Slackware, Ubuntu, Smoothwall
Posts: 1,571

Rep: Reputation: 47
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.
 
Old 07-19-2003, 11:10 PM   #21
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
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
 
  


Reply



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
chmod + umask for a whole dir tree Ephracis Linux - Security 2 08-15-2005 06:55 PM
What can we do if we type chmod ugo-x /bin/chmod ?????? bunny123 Linux - Software 3 02-01-2005 08:53 PM
umask chmod?? blackzone Linux - Newbie 3 01-11-2005 01:50 AM
CHMOD in shell : chmod 777 /usr/ <---is that right? cpanelskindepot Programming 5 07-16-2004 05:37 AM
file perm, chgrp, chmod, and umask Martini Linux - Newbie 2 08-06-2002 08:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:46 PM.

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
Open Source Consulting | Domain Registration