Basic system file editing
From OpenFSG
This Wiki describes a simple & safe approach to editing system files.
I personally find it too risky to edit files using the "vi" command direct in the system root directories. It is possible to use it, But quite difficult to understand & confusing. So here is my suggestion & the way I perform any system file changes on the NDP.
You may have to log in as root! to perform some of your system file changes, So be aware that logging in as root is risky!
Contents |
Enable SSH login on your NDP
Login to your NDP using the web interface.
Go to the Services Tab & click on SSH Server.
Click on Run SSH server check box & the click Apply
PuTTY
I use PuTTY to login SSH to the NDP. This is shareware and can be downloaded after a quick Google search.
This is all the info you have to put in, When youve clicked OPEN, wait for the command prompt to ask for the password. Then obviously, enter your admin password. You will now be logged in.
cd / takes you to the root directory (change directory)
ls will list what's in the directory (list)
su will allow you to login as root! (super user) BE CAREFUL NOW! I believe the default root password is loginasrootisrisky
once you have logged in as root or su "Super User" it may be a wise move to change your su password to something else, just make it a good one ;)
passwd is the command to do this, i.e.
passwd [user] then follow the prompts (see screen shot)
there is a Howto here for login in as root http://www.openfsg.com/index.php/Logging_in_as_root I think it pretty much says what I have put here though.
below is a screen shot of the SHH interface via PuTTY. the example shown is for changing your vsftp.conf file (ftp server settings, see http://www.openfsg.com/index.php/Setup_an_FTP_Server for more info)
User inputs are highlighted in yellow. Explanatory notes are in a tasteful purple.
below is a screen shot for changing a password. to do this you MUST be logged in as root. you can change any users password using this method. the example depicts changing the root or su password.
GVIM
Now, copy the files that you want to edit to a local directory i.e.
cp /etc/theSYSTEMfilename /home/theSYSTEMfilename)
Then make a backup copy of the copied file and put it some ware safe! That way if things go wrong you only need replace the broken file with the origional.
Then I use GVIM 7.1 (also shareware, Google it) to edit the other file, off line. (GVIM is basically the "vi" command but with a decent GUI and it runs on windows.)
Once I'm happy with the changed I've made, I then save the file and exit GVIM, & then replace the original file in the system folder with my edited version, So..
rm (remove) /etc/theSYSTEMfilename & cp (copy) /home/filename /etc/filename
Backup
When that is done I also take the time to put my altered version in the same place as my copy of the original, just rename them in windows to theSYSTEMfilename.origional & theSYSTEMfilename.modified The reason I do this is that if at a later date i need to completely reinstall the firmware, i dont have to edit all my files again, I just cp my versions back to the system folders. My backup versions effectively become the masters.
Finally, reboot your NDP and test your changes have had the desired effect.
PuTTy & GVIM are free ware, other similar programs may & do exist
Enjoy
--alfonz 13:44, 16 June 2008 (CEST)




