LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to Set nobody Permission (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-set-nobody-permission-662052/)

jamesnkk 08-11-2008 01:37 PM

How to Set nobody Permission
 
Hello everyone, I am a newbie in Linux. My company have a tester machine installed with Suse 10 samba.

I have set the IP address of the Linux machine to connect into the Windows 2003 server.
So in my windows XP I could browse thru the machine and also set a share folder /tmp on the linux machine. Everything work perfect, the problem is that everytime the linux generate a new log file and save into the /tmp folder. From Windows XP I cannot move the newly generate log file from /tmp folder to backup folder on linux machine.
When I look at the permission using ls -ls , the permission rwx was given to Root. And it treated me as an "Nobody" user account. How can I change the permission so that "nobody" account also have the rwx permission. Security is not important. How could i perform such change ? May the expert please advise.

mantonr 08-11-2008 02:54 PM

You need to change the permissions of the file from the root account using the chmod command.

If security is not an issue and you aren't bothered who will be able to use the file then you could simply do:

chmod 777 filename

This would give everybody complete permissions on the file. You will have to do this from the root account though given the present permissions.

aleTT 08-11-2008 03:07 PM

I'm not an expert but when I have to change permission of a file or a directory I use the program chmod which stands for change mode.
Shortly:
to use the program do
# chmod XXX yourFile
where XXX is a number of three digit and every digit is in octal.
This allow us to code the permission which are of the form "rwx-rwx-rwx".

This is how numbers are coded in octal and binary
octal....binary
0........000
1........001
2........010
3........011
4........100
5........101
6........110
7........111

So if we do
# chmod 777 yourFile
then your file would get "rwx rwx rwx" permission since 777 in binary is "111 111 111".
if we do
# chmod 234 yourFile
you get "010 011 100" which means "-w- -wx r--".

More info from man chmod and http://en.wikipedia.org/wiki/Chmod .

john test 08-11-2008 04:02 PM

could you just do sudo mv file newlocation?
The sudo command would make nobody Root temporarily ???

aleTT 08-11-2008 04:07 PM

I feel more secure using "su" :)

john test 08-11-2008 04:38 PM

Quote:

Originally Posted by aleTT (Post 3244024)
I feel more secure using "su" :)

There is a TV character named "Monk" that uses that phrase on a regular basis. ;) Sorry bout that, no offenses intended.
I use su myself, but sudo works across platform while su is locked in some distros.

aleTT 08-11-2008 04:56 PM

I can't imagine what kind of TV program is that with such characters in it.
Can you describe me how "Monk" looks like ?

GushpinBob 08-11-2008 05:02 PM

Monk is just a television series starring Tony Shalhoub as the shows main character. More info here: http://it.wikipedia.org/wiki/Monk

aleTT 08-11-2008 05:06 PM

Grazie GushpinBob, ma era per vedere se è veramente cieco o scherza.

chrism01 08-11-2008 06:52 PM

Personally I prefer the symbolic mode, much easier:

chmod ugo=rwx filename

jamesnkk 08-11-2008 10:08 PM

Quote:

Originally Posted by mantonr (Post 3243951)
You need to change the permissions of the file from the root account using the chmod command.

If security is not an issue and you aren't bothered who will be able to use the file then you could simply do:

chmod 777 filename

This would give everybody complete permissions on the file. You will have to do this from the root account though given the present permissions.

I have tried chmod command before, it only work for existing files.
You see the linux tester machine would generate a new file, I do not want to chmod everytime a new file is created.
I heard of umask 000, I have written on the etc/profile, but still doesn't work

jamesnkk 08-11-2008 10:10 PM

Quote:

Originally Posted by john test (Post 3244019)
could you just do sudo mv file newlocation?
The sudo command would make nobody Root temporarily ???

We will need to move the file from windows xp not directly at the Linux machine.SO i cannot use mv.

jamesnkk 08-11-2008 10:22 PM

Quote:

Originally Posted by aleTT (Post 3243964)
I'm not an expert but when I have to change permission of a file or a directory I use the program chmod which stands for change mode.
Shortly:
to use the program do
# chmod XXX yourFile
where XXX is a number of three digit and every digit is in octal.
This allow us to code the permission which are of the form "rwx-rwx-rwx".

This is how numbers are coded in octal and binary
octal....binary
0........000
1........001
2........010
3........011
4........100
5........101
6........110
7........111

So if we do
# chmod 777 yourFile
then your file would get "rwx rwx rwx" permission since 777 in binary is "111 111 111".
if we do
# chmod 234 yourFile
you get "010 011 100" which means "-w- -wx r--".

More info from man chmod and http://en.wikipedia.org/wiki/Chmod .

I don't want to use chmod every time a new file is created. So I though
the best way out is to set permission for nobobdy to rw, since most of the time I will be using windows XP to move the new file to another folder.

jschiwal 08-11-2008 11:34 PM

The /tmp directory may not be the best use as a service. It will contain a lot of junk.

There are two things at play here. First you are connecting as an unauthenticated user from Windows. You should create an account with the same username and password as on windows. Then use "smbpasswd" to add your account/password to the samba database /etc/samba/smbpasswd.

Second, this is a world readable/writable directory, so it also has the sticky bit set to prevent abuse. This means that only the owner of a file can delete a file. Since you are not authenticated, you aren't the owner. You can copy the file from windows but moving involves deleting.

SuSE has a samba-doc package that contains three books. Install that package and read through "Samba 3 By Example" and "Samba 3 Howto & Reference Guide". The package will install them to /usr/share/doc/packages/samba/ in both pdf and html form.


All times are GMT -5. The time now is 04:57 PM.