How do I protect files in Red hat linux 7 from people who log in uder the same user account?
Maybe some encryption or password protection,I don't know,could u please guide me?
How do I protect files in Red hat linux 7 from people who log in uder the same user account?
Maybe some encryption or password protection,I don't know,could u please guide me?
You could simple hide it with the by putting a "." as the first character in the file name. For example: /home/user/.hiddenfile
The hidden file will now not be able to show up with a simple ls, you will need a ls -a or ls -A. Another way would be to encrypt it yet. A 3rd way is to put it in a directory and mount something over it. There will be no way to access the file(except links), unless the unmount is done, that requires some root access though.
Last edited by chrismiceli; 06-12-2004 at 03:16 PM.
Help populate a c/c++ help irc channel
server: irc://irc.efnet.net
channel: #c
how bad do you not want them to see it. You could do as chrismiceli. Your could encrypt it. Here is a simple one(depends on how tech-savy the other person it to figure it out);
Code:
If you can use this great. But I was just joking when I wrote this. To decrypt run it on the ecrpyted fileCode:/*An simple encryption program*/ #include <stdio.h> #include <stdlib.h> int main(int argc,char **argv){ FILE *in; FILE *out; int x=1,y=0; char buffer[BUFSIZ]; if(!(out=fopen("encrypt","wr"))){ printf("Could't create file\n"); exit(1); } if(argc<2){ printf("Usage ./simple file\n"); exit(0); } while((in=fopen(argv[x],"rw"))){ while(fgets(buffer,sizeof buffer,in)){ while(buffer[y]){ buffer[y]^=13; y++; } fprintf(out,"%s",buffer); } fclose(in); x++; } fclose(out); return 0;
At the command line prompt, type
apropos crypt
And use whatever tools / libraries are present on your machine
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
he said it was the same user though. So it wouldn't be that helpful for him either, if they both can be root also. He didn't specfy maybe they always run as root. You never know.
Well not having separate user accounts is a missed opportunity anyway.
If you want to share some files, then make both users part of the same group.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.