hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Hosting Security and Technology : Hosting Security and Technology Tutorials : SSH Newbie Guide
Reply

Hosting Security and Technology Tutorials Tutorials related to server security or the like.
Forum Jump

SSH Newbie Guide

Reply Post New Thread In Hosting Security and Technology Tutorials Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 02-23-2004, 08:19 AM
Joseph_M Joseph_M is offline
Tells All!
 
Join Date: Jul 2003
Location: UK
Posts: 1,879

SSH Newbie Guide


This Guide Isn't By Any Means Complete, But Contains A Number Of Commonly Used Commands In SSH. Please Note That Anything In BOLD Is A Description, And Anything In Italic Is The Actual Command!

File Manipulation
ls -l ---- This Will List All Files/Directories In Your Current Directory
ls -al ---- Lists All Files & Information
ls –alR ---- Lists All Files & Information In All SubDirectories
cd ---- Changes Directory
clear ---- Clears The Screen
cp [oldfilepath] [newfilepath] ---- Copies File From A Directory->Another
rm [filepath] ---- Removes A File
rm * ---- Removes All Files In A Directory
mkdir [dirname] ---- Creates A New Directory
mv [oldfilepath] [newfilepath] ---- Moves A File/Directory


Compression
unzip [filepath.zip]----Unzips A .ZIP File
tar -xvf [filepath.tar]----Untars A .TAR File
gzip -d [filepath.gz]----Ungzips A .GZIP File
gzip -d filepath.tar.gz----Ungziptar's A .TAR.GZ File
tar -xvf filepath.tar


Permissions
0 = --- No Permission
1 = --X Execute-Only
2 = -W- Write-Only
3 = -WX Write & Execute
4 = R-- Read-Only
5 = R-X Read & Execute
6 = RW- Read & Write
7 = RWX Read, Write & Execute

You Need To Set This On Files For
Owner - The File Owner
Group - People On The Server
User - Everyone

Its normally best if you want to keep a file really secure, to keep Group as "0" to stop people on the server from looking/changing it!


System Information Commands

du----Shows Disk Usage
netstat----This Tells You Who Is Connected To The Server + Hostname
netstat -n----This Tells You Who Is Connected To The + IP
kill----Kill A System Process
top----Gives You System Information (e.g. Processes, RAM usage etc)
ps----Shows Currently Running Processes
ps U [username]----Shows Currently Running Processes By A User
last----Tells You The Last User To Login


Last edited by anon-e-mouse; 02-23-2004 at 08:43 AM.
Reply With Quote


Sponsored Links
  #2  
Old 04-30-2004, 03:38 AM
uzaymerkezi uzaymerkezi is offline
Newbie
 
Join Date: Apr 2004
Location: Turkey
Posts: 10
thank you

really good i was hardly looking for these codes as newbie

Reply With Quote
  #3  
Old 05-18-2004, 03:03 PM
stftk stftk is offline
Web Hosting Evangelist
 
Join Date: May 2003
Posts: 472
Nice guide but you may want to add a few things:

- how to extract a .tar.bz2 file to the compression section.

tar -xvjf filename.tar.bz2

- how to create a symbolic link.

ln -s old new

- how to download a file from a remote server

wget http://domain/file

- how to reboot the server

reboot

- how to edit a file

vi filename
pico filename

Reply With Quote
Sponsored Links
  #4  
Old 05-21-2004, 10:33 AM
CybexHost CybexHost is offline
Web Hosting Master
 
Join Date: Aug 2003
Location: USA
Posts: 1,030
This is basically what you need to know to get started and rolling out the door. Great job Joseph_M, very well organized and arranged!

<<< Signature removed >>>


Last edited by choon; 05-21-2004 at 10:57 AM.
Reply With Quote
  #5  
Old 05-21-2004, 11:31 AM
RofyHost RofyHost is offline
Sure we can!
 
Join Date: Oct 2003
Location: Morocco
Posts: 549
Thanks Joseph_M {Tells All!},

you are really telling all
much appreciated!

Reply With Quote
  #6  
Old 05-22-2004, 12:32 AM
basic basic is offline
Disabled
 
Join Date: May 2004
Posts: 128
Some more I often use:

- delete all files AND subdirectories
/bin/rm -rf <directory-name>

- copy folders
cp -r

- show ownership and permissions of files in your location
ls -l

Reply With Quote
  #7  
Old 05-24-2004, 09:44 PM
Adrian_M Adrian_M is offline
Newbie
 
Join Date: Jun 2003
Posts: 14
Not to nitpick,.... but; These aren't really SSH commands.

SSH is just what is being used to remotely connect to a server.

I think these commands would more acurately be described as general UNIX ( or Linux, FreeBSD, *NIX, etc.) shell commands.

Reply With Quote
  #8  
Old 05-26-2004, 08:10 PM
Joseph_M Joseph_M is offline
Tells All!
 
Join Date: Jul 2003
Location: UK
Posts: 1,879
Adrian, as they're for Newbies this is what they'd look for, anyway, I posted exactly what was asked for by (I believe) Mouse.


Last edited by Joseph_M; 05-26-2004 at 08:16 PM.
Reply With Quote
  #9  
Old 06-01-2004, 04:03 AM
coolbuddy coolbuddy is offline
Newbie
 
Join Date: May 2004
Posts: 20
Hey Joseph_M,

Definately a nice informative post ..!
I am sure many people who are new to SSH will be able to use it with the help of your stuff...

Reply With Quote
  #10  
Old 06-05-2004, 07:11 PM
Joseph_M Joseph_M is offline
Tells All!
 
Join Date: Jul 2003
Location: UK
Posts: 1,879
As long as its helped someone, I'm happy!

Reply With Quote
  #11  
Old 06-05-2004, 08:21 PM
gilbert gilbert is offline
Web Hosting Master
 
Join Date: Jun 2003
Location: United States of America
Posts: 1,831
Quote:
Originally posted by Joseph_M
As long as its helped someone, I'm happy!
i second that

Reply With Quote
  #12  
Old 06-05-2004, 09:01 PM
SSH-Raj SSH-Raj is offline
WHT Addict
 
Join Date: Mar 2004
Posts: 113
wow a thread all about me!

Reply With Quote
  #13  
Old 06-09-2004, 12:03 PM
leight leight is offline
Junior Guru Wannabe
 
Join Date: Apr 2004
Location: East Anglia, UK
Posts: 79
some quick notes:

Quote:
ls -l ---- This Will List All Files/Directories In Your Current Directory
ls -al ---- Lists All Files & Information
-l will not list all files, -l is just for (l)ong info line
the -a is for (a)ll, and lists hidden directories and files, (names preceded with a . )

Also useful:

ps -x - show your background processes.
du -sh <dir> shows a human readable summary for the size of a directory.

<cmd> | grep <string> - this will parse all of the output from <cmd> and show only the lines that contain <string>, very useful for machines with lots of processes when you only want to find one. ie: ps -ax | grep named ... this would show the process entry for the dns server.

You have permissions listed but, not the copmmand to change them: chmod <perms> file

Also useful is chown user:group file to change the ownership of a file.

Just a couple of things I think are important, also dont forget that godsend command, "man"

Reply With Quote
  #14  
Old 06-14-2004, 11:46 PM
CArmstrong CArmstrong is offline
Retired Moderator
 
Join Date: Aug 2003
Location: Pittsburgh
Posts: 3,475
To add onto leight's post above, man keyword invokes the manual pages for the keyword. It can be a program, utility, or something else entirely. Give it a shot before you ask a question

Reply With Quote
  #15  
Old 07-22-2004, 09:08 AM
openXS openXS is offline
Web Hosting Master
 
Join Date: Mar 2004
Posts: 990
Isnt quite useful since it doesnt say how to read a file.

For the first time I bought a server and I got an email from the provider asking me to get the pass from a txt via SSH located in some folder. Using the above commands I managed to get IN, but as I was'nt able to open the file, I had to pay them and wait a day to get it done..heh

Reply With Quote
Reply

Related posts from TheWhir.com
Title Type Date Posted
Get listed in WHIR Magazine's 6th Annual Hottest Hosts Issue coming in January 2013 Blog 2012-12-28 11:03:01
Rackspace Blog Looks at Easy Outsourcing for App Development Blog 2012-03-05 19:07:48
Internet Backbone Firm Hurricane Electric Launches Portuguese IPv6 Certification Web Hosting News 2012-02-06 11:40:10
Get listed in WHIR Magazine's 5th Annual Hottest Hosts Issue coming in January 2012 Blog 2011-10-18 18:35:27
Web Hosts Contribute to Roadmap for Government Cloud Migration Web Hosting News 2011-07-26 20:35:47


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

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 On
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?