Protect .profile from accidental delete


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Protect .profile from accidental delete
# 1  
Old 11-03-2005
Question Protect .profile from accidental delete

Hi,

Is there a way to protect users from deleteing their .profile ?

For the majority of our users I created a captive login by a .profile that starts a menu-script. In this menu a user can only start our applications and logoff. This prevents users from getting to the unix-prompt.

However, I foresee a problem when users use FTP/SCP for file-transfer.
Allthough .profile has 400 as file-permission, they can still delete .profile and ftp a new .profile, thus getting to the unix-prompt. Smilie

Oke, I could set users home-directory to 500 (read/execute) but that would prevent applications to write files to the home-directory.

Is there a nice way to protect .profile ? Or can I create a captive-login in another way ?

Tia,
Leon
# 2  
Old 11-03-2005
One possible solution. Change the owner of the .profile to nobody, permissions of the script to 444.
# 3  
Old 11-03-2005
Quote:
Originally Posted by dangral
One possible solution. Change the owner of the .profile to nobody, permissions of the script to 444.
I don't think that will work. As the user still has write permissions on the home directory, s/he will still be able to delete the file.
# 4  
Old 11-03-2005
Make sure that menu script is truly executable. Then make it the shell for the user.
# 5  
Old 11-09-2005
unwanted remove

Hi,

if You want avoid unwanted remove, You can write Your on Script rm to force the user all time use option -i.
Set this as enviroment variable with .profile.
At first UNIX will ask the enviroment then the original command.

Best regards
Dieter
# 6  
Old 11-09-2005
Question Heh something small but maybe helpful

Ok i was reading something in a book about noclobber heres the quote from the book "In the C shell use the command set noclobber. The Korn shell and Bash command is set -o noclobber. Enter the command at the shell prompt or put it in your shell's startup file. After that, the shell will not allow you to redirect onto an existing file and overwrite its contents" *page 70 of Learning the Unix operating system by O'Reilly* Now i am not sure if that is going to help at all but i figured it was worth a shot. Let me know if that helps
# 7  
Old 12-11-2008
Question Question

Were you able to find a way to protect the .profile to be remove by the user ?
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Help with accidental endless loop

I was practicing writing simple loops as I am a new bash user and I created this script, which turned out to be an endless loop where the echo output does not stop and I do not see where my mistake is. #!/bin/bash echo 'enter a number from 1 to 100' read number while do ... (2 Replies)
Discussion started by: goldenlinx
2 Replies

2. UNIX for Advanced & Expert Users

Prevent accidental push of yp maps from slave servers

To prevent an accidental "cd /var/yp; make all" from being executed on an NIS slave server, I found a helpful hint from an instructor in a Solaris class. Just rename the /var/yp/Makefile to Makefile.orig. You will get an error message when trying to execute the "make all" on a slave server. (0 Replies)
Discussion started by: amoser
0 Replies

3. UNIX for Advanced & Expert Users

protect process

how to protect my process from others to kill?? Double post, continued here, thread closed (0 Replies)
Discussion started by: samrintu
0 Replies

4. UNIX for Dummies Questions & Answers

Accidental deletion of root account

I had created a root account when I installed the Centos 5 into my system. But now the problem I'm facing is that I accidently deleted the root user account in my system. Is there a way to recreate the root account in the system now, without reinstalling the OS? Pls help. (1 Reply)
Discussion started by: anaigini45
1 Replies

5. Infrastructure Monitoring

trap in etc/profile and user .profile

Hello I really wonder what's trap in etc/profile and in each user .profile. I try to google for it but I think I have no luck. Mostly hit is SNMP traps which I think it is not the same thing. I want to know ... 1. What's a "trap 2 3" means and are there any other value I can set... (4 Replies)
Discussion started by: Smith
4 Replies

6. Shell Programming and Scripting

How to remove accidental file

Hi, I have a strange problem. I accidentally created a file named ${1}_$(date+%Y%m%d) and when i am trying to remove it I am getting this error . Can any one suggest me how i can remove this accidental file. (4 Replies)
Discussion started by: dsravan
4 Replies

7. UNIX for Advanced & Expert Users

Protect from rm /

We recently had an accidental delete from /. I hold the root password but others are allowed to sudo over to root to perform admin tasks. The only way I want to permit deletion from / is by physically being root (su -). I'd like to add a line to the sudoers file which would permit all commands... (1 Reply)
Discussion started by: scottsl
1 Replies

8. UNIX for Dummies Questions & Answers

changed .profile but didnt ./.profile, yet reflected changes

hi , i added ls -F to .profile. and i need to do ./.profile for the effect to take effect BUT i didnt and YET the next day when i came to work and log in, the changes took effect. i am on aix. please explain.. thanks (4 Replies)
Discussion started by: yls177
4 Replies

9. UNIX for Dummies Questions & Answers

protect dtterm

we have an hp-ux and a user requested me if i can password protect the dtterm. i know that this is possible but can you give me some hints in making this happen? thanks :cool: (2 Replies)
Discussion started by: inquirer
2 Replies
Login or Register to Ask a Question