LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 05-31-2012, 08:26 AM   #1
vm_devadas
Member
 
Registered: Sep 2006
Location: India
Distribution: Redhat and Suse
Posts: 75

Rep: Reputation: 15
chattr and symbolic link


A SLES11 box having custom setup where .profile is a symlink to a central application script. How to prevent users from deleting the .profile file. "chattr +i .profile" will be a quick n easy fix; but it cant be done on symlink, right?
Do you have any easy method to implement this?
 
Old 05-31-2012, 06:51 PM   #2
kakaka
Member
 
Registered: Sep 2003
Posts: 382

Rep: Reputation: 87
Is there any reason the User's .profile could not be a simple script which merely executes the central application script?
 
Old 05-31-2012, 09:02 PM   #3
em31amit
Member
 
Registered: Apr 2012
Location: /root
Distribution: Ubuntu, Redhat, Fedora, CentOS
Posts: 190

Rep: Reputation: 55
if users are login from ssh, you can force them to execute ".profile" or either create a script which loads this profile and make that script as a user shell. so that user's are force to load it.


SHELL SCRIPT SOMETHING LIKE THIS
Code:
cat newshell.sh

#!/bin/bash
source profile/file/path
change user shell to it.


Code:
chsh -s /path/to/new/shell USERNAME
make sure about the execute permission on new shell script.
 
  


Reply

Tags
chattr, symlinks


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
symbolic link not allowed or link target not accessible paullaubscher Linux - Newbie 4 03-10-2010 06:47 AM
symbolic link manolakis Linux - Newbie 1 05-08-2008 07:40 PM
How to create symbolic link to html file and avoid page link problem? haxpor Linux - General 2 01-29-2008 07:40 AM
symbolic link ilnli Slackware 6 01-04-2005 05:05 PM
help with a symbolic link mykrob Linux - Software 6 11-22-2004 10:01 AM


All times are GMT -5. The time now is 11:37 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration