Possible Duplicate:
Redirecting stdout to a file you don’t have write permission on
I'm quite new to Linux and I have a permissions questions. I'm using Linux Mint.
If I go to /opt and do a $ echo hi > file it says permission denied.
If I try with sudo, like this $ sudo echo > file it says permission denied.
Isn't sudo to execute the command as superuser?
In Fedora 17, I'm trying to add a batch of users from a text file using the newusers command. I created a file named users.txt, located in root's home directory.
I encounter a strange problem on a unix/linux machine:
I'm member of a group, let's call it group A and a certain file (which has a different owner) belongs to group A as well. The permissions of that file are
-rw-rw----
so I'd expect I should be able to open that file, but I am not: I'll get the "Permission denied" error message when I try to look at the file's content (using cat).
I am attempting to create a local git repository using a mounted linux drive (via SSH via ExpandDrive) from my mac using GitBox, however when I attempt to make a commit I continually receive this error.
fatal: error when closing sha1 file: Permission denied
I am not exactly sure how to fix this.
In the Linux kernel, I can send a file to the printer using the following command
cat file.txt > /dev/usb/lp0
From what I understand, this redirects the contents in file.txt into the printing location. I tried using the following command
>>os.system('cat file.txt > /dev/usb/lp0')
I thought this command would achieve the same thing, but it gave me a "Permission Denied" error.
Calling dhclient as root works beautifully on my debian machine. However, I would like to allow some users to execute dhclient, too.
Today when i try to ssh into server, i get permission denied. (same for sftp) Ut used to work well before. didn't change any server setting, except was trying to modify a few folders chown permission.
Root user can ssh/sftp without problem.
Any expert can help? thx
(for root user, there is no .ssh/authorized_keys file, only have .ssh/known_hosts file.
When I try to edit my /etc/hostname file, using: sudo nano /etc/hostname (or any other editor) I get the following: Error writing /etc/hostname: Permission denied
I then tried to: sudo chmod u+w ./hostname
and got the error:
chmod: changing permissions of `./hostname': Operation not permitted
I get the same error trying to add write permissions to any use or group.
This is what ls show:
-rw-r--r
Why are Linux file permissions still so primitive and is this likely to ever change?
Each file/dir can only have an owner and group.