Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to login in SSH? and TOP useful SSH Commands
#1
Hello,

First you need to Install SSH Client Software on your PC.

You can use Open Source Putty

Download Putty(Open Source)

Open Putty and then enter your main IP address in "Host Name(or IP Address)"
   
click on "ok"


Now Enter your user name and password (Your Default user name is: root)
   


If you login successfully then show this type of message in putty "~root@examle"
   


Some SSH useful commands:

1. Directory Access
Code:
cd /YourDirectory

2. Delete File/folder
Quote:rm examplefile.ext

Delete file & folders without conformation(be careful)
Quote:rm -rf ExampleFile

Create File:
Quote:touch Filename.EXT
(.EXT = File Extension Name)


Edit File:

Quote:nano Filename.txt
or
Quote:pico /home/username/public_html/index.html

(edit the index page for the user's website)
or
Quote:vi /home/username/public_html/index.html

(edit the index page for the user's website)


Change File Permission
Quote:chmod 775
0 = --- No permission
1 = --X Execute only
2 = -W- Write only
3 = -WX Write and execute
4 = R-- Read only
5 = R-X Read and execute
6 = RW- Read and write
7 = RWX Read, write and execute

Change Owner and Group Permission
Quote:chown username:username Filename
- ChangeGroup Permission
Quote:chown username Filename
- Change Owner Permission
For Example: chown root:root myfile.txt

Move File
mv oldfilename newfilename


Download Files from Internet to your VPS
Quote:wget http://example.com/filename/file.tar.gz


Extract & Create TAR Files

tar -zxvf file.tar.gz: Extracts the file
tar -xvf file.tar: Extracts the file
tar -cf archive.tar contents/ : Takes everything from contents/ and puts it into archive.tar

shows who logged in and when...
Quote:last -20
(shows only the last 40 logins)
Quote:last -40 -a

(shows last 40 logins, with the hostname in the last field)

Currently Loggid in User
Quote:w

(shows who is currently logged in and where they are logged in from)

Quote:who

(This also shows who is on the server in an shell)
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)