How do I change the ownership of /cygdrive/c - cygwin

I need to create a file in /cygdrive/c but that folder is owned by "NT SERVICE+TrustedInstaller". All the posts I've seen say to right-click on the folder in Windows and change the ownership. But I can't find /cygdrive/c in
Windows. And I can't change the ownership in Cygwin.
I've tried changing the permissions in cygwin:
$ /cygdrive
$ chmod 777 c
chmod: changing permissions of 'c': Permission denied
I've tried vi /cygdrive/c/.netrc
but when I save I get:
".netrc" E212: Can't open file for writing

/cygdrive/c IS C:\. by Doug Henderson does resolve my issue.
C:\ has one owner and /cygdrive/c has a different owner. My original problem was that I was trying to create a file in /cygdrive/c and it wouldn't let me. Hence the need to change ownership. However, they are the same place, so I just went to Windows and placed the file in C:. Now I can get to the file in /cygdrive/c. So this does resolve my problem.

Related

how to set file permission to directory in linux..?

how to set file permission to directory that directory permission is assign automatically to files under that directory when we create new file into the directory
please any one let me know who know the answer
I think you're asking about how to make files inherit permissions from their parent directory. I will assume you're using GNU/Linux (you've added the redhat and ubuntu tags), in which case this can be done from the terminal by assigning group ownership to the directory and getting the children (files) to inherit from there.
To do this:
Recursively set the directory permissions:
chmod -R <octal permission code> /path/to/parent_dir
Recursively change ownership of directory:
chown -R <you>:<yourgroup> /path/to/parent_dir
Set inheritance of group ownership with setgid bit:
chmod g+s /path/to/parent
Note that the setgid bit means that executables will run with the same permissions as if they'd been run by the group: see here. If you don't understand the permissions, the easiest way to find the chmod octal code (for a beginner) is with a calculator. This is also a duplicate and probably doesn't belong on here, but since I can't see it mentioned on stackoverflow (it is on the Ubuntu StackExchange and Super User StackExchange) I'll answer here :)

Cannot create directory in tmp(overthewire bandit24)

I'm trying to solve bandit24 on overthe wire on ubuntu virtual machine.
I have already seen the solution.
But i have a problem,when i try to create a directory on tmp as bandit24#bandit i get this message:
Cannot create directory "name_of_directory": file exists.
If I try with find command there is only the "." directory and with ls I get the message:
Cannot open directory '.' : permission denied.
I also have tried with ls -l on tmp and I get the message:
Cannot open directory 'tmp': Permission denied
What else could I do?
What could be the problem?
Try to prepend sudo at your command. Seems you don't have permissions to read the /tmp directory, what is pretty weird.
Example that might works:
To list the /tmp contents:
sudo ls -l /tmp
To create the 'my_new_dir' inside /tmp:
sudo mkdir /tmp/my_new_dir
It means that there is a directory under /tmp/ with the same name that you specified. But since you did not create it (in this case, someone created with a different bandit user), you cannot view it. There is not read permission for bandit24 to access it.
Since /tmp/ is directory accessible for all user accounts, you cannot list the files/directories under it without the root permission. (Which means the root of the bandit machine has configured like that)
What you need to do
Try a random name. Create anything random under /tmp/. It will work.

User folder accidently relocated, don't have permissions to move it back (Read only file system)

Thanks to a rashly typed mv command and my inexperience in installing LaTeX packages, I managed to move my user folder--let's call it /home/bob for the purposed of not revealing my name--somewhere else. I started a recovery terminal and found bob buried down in usr/share/texlive/texmf-dist/tex/latex.
I tried moving the folder back (going to usr/share/texlive/texmf-dist/tex/latex and running mv bob /home/, but I got the message
mv: cannot move 'bob' to '/home/bob': Read-only file system
I don't really know what else to do to fix this... Do I just use chmod and change the permissions or do I have to remount something? Since these are all my files, I'd rather ask and be sure than play around more and just make things worse.
EDIT: I tried chmod 777 bob but got the message
chmod: changing permissions of 'bob': Read-only file system
Also, mkdir /home/bob gave me a similar error (Read-only file system)
Use chmod
chmod 777 bob
mv bob/ /home
or You can create a folder with similar name
mkdir /home/bob

How do I fix the uploading error in aptana studios: parent path doesn't exist

I have a quick question. I've been trying to upload my website to blue-host, but every time I try, it says that parent path doesn't exist, is there a way I can change the parent path so the uploads work
Thx,
willmonferno
This is likely due to file permissions, you don't have write access, try updating file owner or file permissions.
I'm guessing you on some type of linux system, so you either need a chown (change owner) shell command or a chmod command (change file permissions) on the parent folder
try:
sudo chmod -R 777 {YOUR_PARENT_FOLDER}
This will recursively change this and all other files and folders below it in the file tree to allow everything. I would change it once you're in a production environment.

overwrite permission for .mycshrc in linux

I am trying to edit my .mycshrc file to add in more shortcut commands in my terminal.
However, I realize there is a problem.
It appears that my file was replaced by a senior (he is gone, the same goes to the computer) and I am unable to edit it due to the permission rights where the options in the Permissions tab are all greyed out.
I tried typing chmod 644 .mycshrc and I was given the error: chmod: changing permissions of .mycshrc': Operation not permitted
Then I tried to create a new plain text document file, rename it as .mycshrc and it ain't working even as I have added in new commands unless I am doing it wrong..
The following is a sample that I am trying to add it in:
alias designer '/apps/Linux64/qt/qt-4.5.0/bin/designer'
You need to change the user, and not the file mode in this case. Use
sudo chown youruser:youruser .mycshrc
where youruser is your username.
In any case, the chmod 644 .mycshrc was failing because you aren't the owner of the file (the senior's user account is the owner most probably since he replaced it). That is precisely the reason why you need to do the above step with sudo, as the root user.
Find out a easier way to handle the problem I am facing.
Delete away the old file
Create a new file (make sure file format is the same as the old one)
Add in any new alias if necessary
type source ~/.mycshrc in command line
Viola~ It works!
Make sure you are in the directory when the file is being saved since it works for me in this manner

Resources