Setting Default Directory Permissions For New Directories

This should be an easy fix and I'm at a loss. I have a directory with 777 permissions on it and currently any directories created inside it default to

drwx--S---

I need to remove the sticky bit and also set any new directory to be readable by group X. How can I do this?


Similar Content



Assign Group Permission To Newly Created Files

Directory /media/data/torrents/ has permissions 775, user yzt, group transmission

yzt and debian-transmission are members of the group transmission.

transmission-daemon is run by debian-transmission, and the new files it downloads have permissions 644, owner debian-transmission, group transmission. This is a problem, because I can't later move the files as my user, yzt, and need to be switching to root to change the permissions/ownership to be able to do so.

Using sticky bit I could copy it to anywhere else, but I'm interested on actually moving the file, not just copying it. I could run transmission-daemon as yzt and problem solved, but I rather have that internet facing service running by a limited user, just in case some vulnerability is found on Transmission.

So my question is, how can I set that every new file created under /media/data/torrents/ has permissions 775 like its parent directory?

Help With The Modifying Apects Of .bash_profile

I'm new to Linux and I'm trying to learn about .bash_profile. I want to be able to set up various aspects of it, such as setting default permissions for new files, changing the format of the prompt. I also want to modify it so that the current directory is appended to the default PATH.

Can anybody give me a brief rundown on the code/syntax and whatnot for these things?

ex: what is the line that I would need to type so that my prompt is formatted "command number - user - machine name - current directory"?

Connecting To Specific Directory With Filezilla

Hello, I have an embedded linux device. I can connect to the device and I can upload or download files. No problem with this. But, at first connection, I want to connect to "/" directory instead of "/root". In the device file system, there are files ssh_config and sshd_config under /etc/ssh directory. I think I have to do something with these files but I don't know what.

I don't exactly know what mean "/root" and "/" directories. I think that the real root directory is "/" directory which is empty but when I connect with filezilla, the "/root" directory is the default so I had to go back to / directory everytime.

Having Problem While Inserting New Enteries In Csv File

Hi Experts,

I am trying to make new enteries in a csv file in new column but am not able to do so.Please help for the same.

Requirement:

There are multiple directories & within those directories i have sub-directories and i want to build a csv file with 2 columns of Directories mapped to their sub-directories. Can you please help me with this. I tried the following code:

Code:
#!/bin/bash

homeDir="$HOME"



ls ~/Parent/ | cut -c1-9 > ~/test_111.csv

while read Child

do

Entry="$(ls $homeDir/Parent/$Child/ABC/XYZ/DEF/PQR)"

echo $Entry

for (( c=1; c<=5; c++ ))

do



sed -i ci"$Entry" test_222.csv

done


done < test_111.csv

Basically i want two columns of csv file , First column should have Child name & Second cloumn should have Sub-Directory name inside PQR Directory.

Any help will be useful on this.

Thanks in Advance!

Best Regards,
Vijay Bhatia

What Does The "T" Mean When You List File Permissions W/ Ls -l

I have a directory w/ a file that I created using:
Code:
fd = open("file", O_CREAT);

The file turned out to be executable. When I did a 'ls -l' on the directory w'/ that file it has a "T" at the end of the permissions where the executable bit would be set for the "other" group.

Chown Question For Subdirectories

I have a directory structure and files I wish to change permissions on, but I don't want to change permissions on every file/subfolder along the way. Example: I want to chown all files in dir4 where my directory struture is:
/dir1/dir2/dir3/dir4/*
However, both dir3 and dir4 are owned by root:root so I need to change the ownership on those directories as well. But, if I do:
chown -R user:group /dir1/dir2/dir3/dir4/
...it will indeed make dir4 and it's files accessible, but it doesn't change dir3 - so folks still can't get to the files they need. I thought about doing:
chown -R user:group /dir1/dir2/dir3*
... but that will give users access not only to dir4 and it's files, but any other files under dir3 which I don't want.

My work around has been to do a chown on /dir1/dir2/dir3 and then a second chown on /dir1/dir2/dir3/dir4/, but I am thinking there has to be a way to do what I want in a single chown command - right?

Securing /etc/profile And /etc/bashrc

Changing umask value for files and directories take effect after reload:
/etc/profile
/etc/bashrc
default permission for all users:
-rw-r--r--
above permission is edited to:
-rw-rw-r--
If a specific user in group having only read permission to a file/directory is created before reload,and Linux server reloads, that user gets rw permission to that file/directory. what is the alternative of securing:
/etc/profile
/etc/bashrc
apart from giving the two files access to root user only, and locking out all other users?

Ls Command Lists Each File On Separate Line

Don't know how but now when I use ls I get list of files and directories on their own lines. I want the default behavior I had before. When I cd into another directory I have default behavior - horizontal list of files and folders.

Not Readable Name Of Directory In Linux Mint 13

I've got a directory with not readable name in my home directory. I suspect it is in russian language, but not sure.How to "translate" it?

Setuid, Setgid, Sticky Bit

There's something really weird happening with permissions on a directory in linux. I have the directory /dir

Code:
ls -ld /dir
drwxrwxrwx. 2 root root 4096 Jan  8 00:06 dir
chmod 2777 /dir [this sets the setgid bit on]
ls -ld /dir
drwxrwsrwx. 2 root root 4096 Jan  8 00:06 /dir

And this is what I expect it to do.
However, when I change it to setid (WITHOUT setgid), it simply doesn't work. Instead of overwriting, it cumulates:
Code:
chmod 4777 /dir [for setting setuid bit on]
drwsrwsrwx. 2 root root 4096 Jan  8 00:06 /dir

As you can see, the setgid bit is still on together with the setuid! However, if I run:
Code:
chmod -s /dir

then the file has a 0777 permission.

And then again, if I change its permission to 4777 (so setuid):
Code:
chmod 4777 /dir
drwsrwxrwx. 2 root root 4096 Jan  8 00:06 /dir

it acts normally. So the same chmod 4777 acts differently in two different contexts.

I really can't understand it. Basically, I cannot get rid of the setuid/setgid through binary permissions. The sticky bit works fine. Changing from 1777 to 0777 adds and removes "t" respectively. What am I to make of all this? This behaviour makes no sense to make especially given that we can change the permissions to 6777 (setuid + setgid).