LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 02-04-2009, 01:21 PM   #1
duval_jay
LQ Newbie
 
Registered: Feb 2009
Posts: 13

Rep: Reputation: 0
How can I setup my system to make a command alias for all users?


Anyone know how you create a command alias for all users so they can empty a temporary directory.
 
Old 02-04-2009, 01:25 PM   #2
arizonagroovejet
Senior Member
 
Registered: Jun 2005
Location: England
Distribution: openSUSE, Fedora, CentOS
Posts: 1,094

Rep: Reputation: 198Reputation: 198
Well 'empty a temporary directory' is a little vague but assuming your users have bash as their shell put an alias in to /etc/bashrc. Though on SuSE systems it's called /etc/bash.bashrc and if you read the comments at the top it tells you not to put your own stuff in that file but to put it in /etc/bash.bashrc.local

If you don't know how to do bash aliases then

Code:
alias foo='some bunch of commands'
 
Old 02-04-2009, 01:56 PM   #3
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836
Blog Entries: 1

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
If you are talking about /tmp directory - that's probably not the best idea as one user will be able to delete some temp files that another user's application is using at that time.
 
Old 02-04-2009, 02:52 PM   #4
arizonagroovejet
Senior Member
 
Registered: Jun 2005
Location: England
Distribution: openSUSE, Fedora, CentOS
Posts: 1,094

Rep: Reputation: 198Reputation: 198
Quote:
Originally Posted by sycamorex View Post
If you are talking about /tmp directory - that's probably not the best idea as one user will be able to delete some temp files that another user's application is using at that time.
Users can't delete other user's files in /tmp. At least not unless the default permissions and/or ownership of /tmp have been changed which would not be a sensible thing to have done. Default permissions and ownership on /tmp looks like

drwxrwxrwt 14 root root 4096 2009-02-04 20:00 /tmp/

the significant part being that t which represents the sticky bit that allows any user to create a file in /tmp but only to delete files which they own.
 
Old 02-04-2009, 02:57 PM   #5
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836
Blog Entries: 1

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
Quote:
Originally Posted by arizonagroovejet View Post
Users can't delete other user's files in /tmp. At least not unless the default permissions and/or ownership of /tmp have been changed which would not be a sensible thing to have done. Default permissions and ownership on /tmp looks like

drwxrwxrwt 14 root root 4096 2009-02-04 20:00 /tmp/

the significant part being that t which represents the sticky bit that allows any user to create a file in /tmp but only to delete files which they own.

I'm aware of all of it. I wanted to discourage the OP from tampering with /tmp (eg. by removing the sticky bit) to enable users to empty it (ie. delete its contents)

Last edited by sycamorex; 02-04-2009 at 02:58 PM.
 
  


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
Command for showing a report for all users on the system. ricelover Linux - General 5 04-19-2007 03:06 PM
command to list all users of the system?? simi_544 Linux - Networking 9 09-29-2005 03:00 AM
how to make su command available to all users zchoyt Linux - Software 7 04-14-2005 03:35 AM
how to I add users to my system thru a program I make? r_squared Linux - General 3 12-11-2004 07:55 PM
How to get list of system users from command line? tictocdoc Linux - General 3 03-12-2004 03:06 PM

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

All times are GMT -5. The time now is 09:59 AM.

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