Jump to content
xisto Community
loramchugh

Why Ssh Access On A Web Host Is Great

Recommended Posts

Among the many reasons every web developer should want SSH from a web host, like security, is the ability to edit your web pages directly from the command line. With shell access, you can use the myriad of GNU/Linux system tools to exercise complete control and domination over your web site. Here are some of the tools I use most often:

 

Vim (or vi)

This is the first text editor I ever learned to use. Among the functions in vi that I use most often are "set nu" to show line numbers, "%s/<text to replace>/<replacement text>/g" to replace all matching text in a file, "r <filename>" to read a file and insert it into the current file at the line after the cursor, and "/" to search for a string.

 

Emacs

I used emacs for a few college courses, but I was always more comfortable with vi, so I didn't stick with emacs. However, in recent years, I've been discovering some of the wonderful features in emacs, like the ability to write your own commands in elisp and the alt+q command to automatically insert line breaks -- a feature that I have found to be indispensible.

 

grep

When your web site grows in the number of files, grep comes in handy when you want to find some specific text, and determine which file contains that text. For example, if I want to edit the style for a specific div id or class, and I have multiple stylesheets, I can use the following command to list all the files that contain the div id I'm looking for.

grep -l <text to find> ./*.css
(the l option tells grep to list the file names of the css files that contain the text in the place of <text to find>.

Share this post


Link to post
Share on other sites

I posted this in the wrong section. This probably should have gone in the "Websites and Web Designing" section. Can an admin please help me move it?

This text looks more like basic Linux operating systems tips and tricks. Each linux admin has first to learn how to use vi.vi is not the first thing you have to know if you are designing a website, most of web designers create their website on their own computer and use a ftp client in order to put it on the final server, they use vi only for checking some bugs.
That's why I moved yor topic here, where it's place most probably is.
Regards
Yordan

Share this post


Link to post
Share on other sites

I like using SSH over FTP, it gives you more control. Xisto use to offer SSH, I am not sure if they do now though.I have never used emacs because you will usually find vi is installed by default with most Linux distributions. I find no reason to add another editor to the system.grep is a great tool, I use it for all sorts of searching.Eventually I will get round to writing guides on using vi(m) and grep since if you want to be a terminal user, understanding these two programs will help. I will also write how to setup an SSH server and how to connect to it but it's just like having remote terminal to your system over a secure connection, so explaining how to use it won't be necessary if you already can work terminal.Cheers,MC

Share this post


Link to post
Share on other sites

I like using SSH over FTP, it gives you more control. Xisto use to offer SSH, I am not sure if they do now though.


Yes, SSH is still available as an addon albeit a paid one.. 11.88 USD per year or 0.99 per month :)

As for the commands, I find VI icky... Sorry but somehow my brain could never comprehend vim ever..I actually prefer nano over them all, simple and straightforward.

I too prefer the command line over FTP but that is mainly because I am lazy :lol:

Personally, perks of command line for me include things like mass permissions change / ownership correction.. Debugging & executing files without the need of a browser .. And the LOGS!!! All those pretty lines of garbled text waiting just for you to read through, always makes me happy :D

I think all linux administrators would unanimously agree about grep.. One of the most useful search tools... Essential for logs and searching through files T_T

@mastercomputers I think along with those tutorials, you should also cover aspects like creating an error log and reading / understand them.. Personally, I have been dying to write a topic about creating a Virtual Private Server from scratch BUT it requires time that I don't have enough to spare :

Share this post


Link to post
Share on other sites

nano/pico is for softies, nah it's actually pretty good and novice friendly, It may have some powerful features but I haven't used it enough to discover them. vi has kept me happy, although I remember first using it... now that was a nightmare but once you memorise all the commands, it just shows what persistent can do.I've added reading logs to my to-do list and probably logrotate so we don't store years of logs. Deciphering garbled text makes you happy? This is an area where I wish they were more simple and just said, [ERROR] I'm an error, fix me.You sure you don't want to write a topic on creating a VPS from scratch? I might beat you to it if you don't. Maybe CentOS with KVM.Cheers,MC

Share this post


Link to post
Share on other sites

also learn how to make backup/restore using standard Unix tools:

cd /myfiletime find . -print |cpio -pmduv /mybackups/myfilecd /find myfile -print |cpio -omBdv >myfile.cpiotar xvf myfile.tar myfile

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.