Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
How can I create a file (not directory) with execution permissions using umask?
I know files use 666 permissions and directories 777 but I want to create files with 766, for example.
Use chmod to change the file permissions.
chmod 777 some-file
Or set the umask
umask 000
Strictly using umask, you cannot do this. Unless you are specifically creating an executable file with, say, gcc, the default permissions will be 666 minus umask. You must use chmod to add the executable bit to a standard file.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 years ago.
Improve this question
I just coded a script in bash on Ubuntu but I don't know where I should put it...
I read I had to put it in /usr/bin in a tutorial but maybe it's better directly in /bin ?
This is the difference between both directories:
/bin
It contains commands that can be used by both the system administrator and the users, but which are necessary when other file systems are not mounted (for example, in single user mode). It can also contain commands that scripts use indirectly
/usr/bin/
This is the main directory of executable commands in the system.
Therefore, it will work on both, but you must establish what responsibility your script has.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
I have /home/eric/public_html with drwxr-x--- eric:nobody as the mod and ownership.
I login with eric so I cannot recreate this folder without root access, since eric is not part of the nobody group.
I want to replace my public_html with a symbolic link (i.e. ln -s ~/git/project/src ~/public_html) but if I do that, my new public_html ends us without the correct permissions.
Is there a trick to get around this without contacting my admin?
Possibly by doing the following:
Copy everything from ~/git/project/src into ~/public_html
mv ~/git/project/src ~/git/project/src2 to get it out of the way
mv ~/public_html ~/git/project/src
finally link it back: ln -s ~/git/project/src ~/public_html
The idea is to keep the original public_html directory because it has the correct owner/permissions, but reuse it as the link target.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
I created the directory "science" using mkdir science from /home/anu directory. And typed chmod 664 science.
step 2:-
/home/abc/science -> created a file chemistry in it using touch chemistry and typed chmod 664 chemistry.
Step 3:- Added new user to group anu using "usermod -aG anu user1" .
Step4: Went to /home/user1 and typed rm -rf /home/anu/science/chemistry but got access denied even when i am a part of group anu.
Please can you advise.
When you create new users and adding them to new groups it's recommended to relogin under new session.
Also, show rwx permission for /home/anu, /home/anu/science and /home/anu/science/chemistry. Chances are - there is an answer
your folder(science) is 664 which does not allow you to rm file(chemistry) in it. Change folder to 774 and have a try
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I want force users to use 'srm' instead of 'rm' command. is there any solution to execute 'srm' command when users run rm command? or deny users permissions to run 'rm'?
Just create an alias:
alias rm='srm'
You can put this command in the .bashrc file for the user you have to keep under control, so that it is automatically loaded at login.
You can also put it into /etc/bashrc, so that it's loaded for ALL the users.
You can use aliases to do this.
Create an alias as ,
alais rm="srm"
Add this in to the bash_profile or bashrc file or even better create a bash_alias file that will be called from bashrc file.
For a general intro on Aliases, refer this http://bit.do/freblogg-aliases
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
After I accidentally used the command chown /var/www/moodle, I couldn’t change the root directory to be /var/www/moodle, so that I can't install phpmyadmin.
I have looked some suggestions but not very useful, I guess the permission has now changed, the other problem is I don't remember in which root directory I have used the above command.
What I get right now:
chroot: cannot change root directory to /var/www/moodle: Operation not permitted
I am using linux for the first time.
Your first command, the chown /var/www/moddle, was syntactically bad. You had to run some other, if you didn't get back an error message.
First, try a
chown root:root /var/www/moodle
...although a chroot command should be able to be called. Probably there is also another problem, what gets you if you call a
chroot /var/www/moodle
?