Linux / UNIX Tech Support Forum
This is a discussion on VI & PHP Security Remove swap and backup file within the Linux software forums, part of the Linux Getting Started category; Hi I've discovered a large security risk on my apache server. I'm running a couple of PHP based websites and ...
|
|||||||
| Linux software General questions and discussion about Redhat/Fedora Core/Cent OS, Debian and Ubuntu Linux related to softwares should go here. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hi
I've discovered a large security risk on my apache server. I'm running a couple of PHP based websites and often makes small changes in the config file or some of the other php files. I do this over SSH using VI. But I've discovered that sometimes VI makes a temporary file with the same name as the orginal file but with a ~ at the end. This means that if I have edited my config file config.php there is a temporary file called config.php~ and this file can also be accessed and will not be parsed as a php file, hence everyone can see usernames, passwords and other goodies. So my questions are: - Is there a way to avoid that VI makes these files? - Or is there another command line editor I could use instead that does not make them |
| Sponsored Links | ||
|
|
|
||||
|
Open your $HOME/.vimrc file and append following to disable backup option
Code:
set nobackup set nowritebackup Code:
set backupdir=./.backup,.,/tmp
set directory=.,./.backup,/tmp " Automatically create .backup directory, writable by the group.
if filewritable(".") && ! filewritable(".backup")
silent execute '!umask 002; mkdir .backup'
endif
HTH
__________________
Vivek Gite Linux Evangelist |
![]() |
| Tags |
| .vimrc , vi stop backup files , vim |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| AIX /etc/security/user like file for Linux | ftengcheng | Getting started tutorials | 4 | 25-03-2008 01:28 AM |
| Why Swap=2 x RAM | diptanjan | Getting started tutorials | 5 | 25-03-2008 01:14 AM |
| Ext2 file system : Mechanism on number of backup Superblocks ? | swapnil | Getting started tutorials | 1 | 03-09-2007 06:40 PM |
| Swap | piggy | Getting started tutorials | 3 | 17-07-2007 09:44 AM |
| Difference between Linux Swap partition & Swap file | hrishikesh | Linux software | 9 | 16-03-2007 02:08 AM |