LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-12-2006, 11:34 PM   #1
olbaid
LQ Newbie
 
Registered: Apr 2006
Posts: 2

Rep: Reputation: 0
Some simple newbie questions


How do you doing the following?

- Change the server so that the default permissions on all newly created files are -rw- rw- r--/
- Change permissions on all files currently in the /tmp directory to 751
- Put back the passwords from the /etc/shadow file back in the /etc/passwd file

Thanks in advance...
 
Old 04-13-2006, 12:20 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Homework, by any chance??

What server are you referring to? Is it one that you have administrator access to?

"Put back the passwords"---Why were they moved? In /etc/shadow, are they not encrypted?

Change permissions is done with chmod. "man chmod" for the details of the syntax.
 
Old 04-13-2006, 12:24 AM   #3
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
You havn't told us which distro this is...
In general

- change server for file permissions ...
For me, I am using nautilus in FC4, and it has always done this. New files are always -rw-rw-r-- unless they are directories, in which case they are drwxrwxr-x because you need execution permission to view the directory contents.

So: what do you mean by "server"?

- change permissions of all files in temp dire to 751

chmod 751 /temp/*

for eg... on a spare directory of files I have:
Code:
# ls -l
total 640
-rw-r--r--  1 simon simon   2748 Jun 24  2005 general11.gif
-rw-r--r--  1 simon simon   2885 Jun 24  2005 general12.gif
-rw-r--r--  1 simon simon   7434 May 14  2005 kowhai_gold.jpg
[extra listings deleted]
# chmod 751 *
# ls -l
total 640
-rwxr-x--x  1 simon simon   2748 Jun 24  2005 general11.gif
-rwxr-x--x  1 simon simon   2885 Jun 24  2005 general12.gif
-rwxr-x--x  1 simon simon   7434 May 14  2005 kowhai_gold.jpg
[extra listings deleted]
#
man chmod for more detail. (Though, why you would want "others" to be able to execute files they cannot see, escapes me.)

- put passwords back into /etc/passwd
Why on earth would you want to do that?
http://geodsoft.com/howto/password/

Last edited by Simon Bridge; 04-13-2006 at 12:26 AM.
 
Old 04-13-2006, 12:36 AM   #4
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
1. I guess umask 0111 (in the login script of every user)
2. chmod -R 0751 /tmp
 
Old 04-13-2006, 12:47 AM   #5
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
umask 0113 for -rw-rw-r-- surely?
 
Old 04-13-2006, 12:50 AM   #6
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
Oops, it's my typo..
 
Old 04-13-2006, 01:19 AM   #7
olbaid
LQ Newbie
 
Registered: Apr 2006
Posts: 2

Original Poster
Rep: Reputation: 0
Sorry the distro is SuSE 9.0
 
Old 04-13-2006, 01:51 AM   #8
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
The umask can go in /etc/bashrc (for all bash shells) or /etc/profile (for all logins).

As for the chmod, the OP asked to change only the permissions on files, not subdirectories of /tmp.
So I suppose he'll be needing a script like this:
Code:
for i in `ls /tmp`; do
  if ( -f /tmp/$i ); then
    chmod 751 /tmp/$i;
  fi;
done;
or use a find command like:
Code:
find /tmp -type f -maxdepth 1 -exec chmod 751 {} \;
As for moving the passwords from shadow to passwd file, I agree with Simon_Bridge. They were put (encrypted) in the shadow file for a security reason. So, keep them in there.

Last edited by timmeke; 04-13-2006 at 09:59 AM.
 
Old 04-13-2006, 02:41 AM   #9
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
olbaid: please put your distro in your profile. Thank you.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
hi there... i'm a newbie with few simple questions :o) ram0503 Linux - Newbie 2 02-01-2005 12:25 AM
Simple Questions...Hopfully Simple Answers. caps_phisto Linux - General 3 12-21-2004 12:40 PM
a few very simple questions for a complete newbie czechripper Linux - Newbie 6 10-17-2003 06:38 AM
WOW, real newbie here with simple questions =) mfarley Linux - General 29 07-21-2003 08:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration