Professional Documents
Culture Documents
BasicCentOSSetupBeforeBuildingAWorkingServer
STEAL DEALS:
HOW TO
TOPICS :
NEWS
ABOUT
SITEMAP
WRITE FOR US
RECOMMENDED
VPS
Complete list of best
VPS hosting
providers.
Searchthesite
GreenHosting
GetSecure&PowerfulDedicatedServersonlyfor130$permonth.
Clickhere.
ads by BSA
1/25
5/14/2015
BasicCentOSSetupBeforeBuildingAWorkingServer
HOW TO ADD
NEW WEBSITE
ON VESTA CP
84 Comments
Following all steps in this initial CentOS server setup is not a must
but strongly recommended. However the decision is up to you. I
BASIC CENTOS
SETUP BEFORE
BUILDING A
WORKING
Step 1 Login to your remote server via SSH connection. You can
use either use Terminal (Mac / Linux) or Putty in Windows. You
should login as root. Read my previous articles:
Where To Download Putty and How To Use It
Top most used Unix commands to SSH to a Linux server
During your first login, Putty (or Terminal) will ask you to cache
servers host key in the registry and remember servers ras2 key
SERVER
72 Comments
HOW TO ADD
NEW SITE
INTO YOUR
APACHE-BASED
CENTOS SERVER
71 Comments
HOW TO BUILD
OPENVPN
SERVER ON
CENTOS 6.X
60 Comments
HOW TO
INSTALL
VESTACP ON
CENTOS 6.5
VPS
54 Comments
2/25
5/14/2015
BasicCentOSSetupBeforeBuildingAWorkingServer
passwd
Make sure you use strong words and numbers combination but
also make sure you can easily remember it.
Step 3 Create new user. This new user will be used for you to
login to your server in the next time because you have to also
disable root login (Ill tell you in the next steps) because root is
really a standard username hackers can easily guess. Its just like
admin or administrator in Windows. Use command below to
create new username:
1
/usr/sbin/addusernewuser
passwdnewuser
Upon hitting Enter on your keyboard your server will ask you to
type the password for that user.
http://www.servermom.org/basiccentossetupbeforebuildingaworkingserver/414/
3/25
5/14/2015
BasicCentOSSetupBeforeBuildingAWorkingServer
/usr/sbin/visudo
#Userprivilegespecification
rootALL=(ALL)ALL
##Allowroottorunanycommandsanywhere
rootALL=(ALL)ALL
How to edit? If you dont have Nano editor installed yet, simply hit
a (without quotes). Once done adding new line, simply hit Esc key
to exit editing mode. Now press Shift key + ZZ to save and exit vi
editor.
Step 5 Change SSH default port and disable root login. This is
what I mean in step 3 above. In this case youll need to edit
http://www.servermom.org/basiccentossetupbeforebuildingaworkingserver/414/
4/25
5/14/2015
BasicCentOSSetupBeforeBuildingAWorkingServer
nano/etc/ssh/sshd_config
#port22
port22000
#PermitRootLoginyes
PermitRootLogin no
So it will look like this:
#UseDNSyes
5/25
5/14/2015
BasicCentOSSetupBeforeBuildingAWorkingServer
UseDNS no
It may look like this:
Dont close Nano editor just yet, now proceed to the next step:
Step 6 Allow new user to login via SSH to your server. Simply
add this line in the very bottom of that file:
1
AllowUsersnewuser
/etc/init.d/sshdreload
6/25
5/14/2015
BasicCentOSSetupBeforeBuildingAWorkingServer
instance then login using new SSH port, new username, and of
course new password.
After the changes, youll see your new username instead of root:
Enjoy..
SHARE THIS:
32
RELATED POSTS
HOW TO ADD NEW
CONNECTING YOUR
WEBSITE ON
KLOXO-MR CP
DOMAIN USING
ZPANELX CP V10.1.1
IS NOW AVAILABLE!
31 Comments |
Mar 4, 2014
BASIC SECURITY
SETUP FOR CENTOS
WEB PANEL
15 Comments | Jan 7, 2015
http://www.servermom.org/basiccentossetupbeforebuildingaworkingserver/414/
7/25
5/14/2015
BasicCentOSSetupBeforeBuildingAWorkingServer
72 COMMENTS
saeed
Reply
hi/
Really helpful
Thanks
Tendai Afrika
Reply
Siddeswara
July 3, 2013
Reply
Sawiyati
July 6, 2013
Reply
Neville Scollop
Reply
8/25
5/14/2015
BasicCentOSSetupBeforeBuildingAWorkingServer
and save configs, you dont make that assumption and I love it
for that!
Sawiyati
Reply
Ali Douglah
Reply
abu
Reply
Cyrus
August 2, 2013
Reply
9/25
5/14/2015
BasicCentOSSetupBeforeBuildingAWorkingServer
Daniel
Reply
Thanks for this great and clear tutorial for a VPS beginner like
me!
Nathan
September 1, 2013
Reply
Virtual
October 2, 2013
Reply
You forgot to mention that they need to allow the new ssh port
through iptables.
Sawiyati
October 5, 2013
Reply
thanks
Jim
Reply
Foro Ovnis
Reply
Great tutorial. You should also add how to forward the new
SSH port in iptables though, many people might get locked out
if they forget not to close their active section or if their
http://www.servermom.org/basiccentossetupbeforebuildingaworkingserver/414/
10/25
5/14/2015
BasicCentOSSetupBeforeBuildingAWorkingServer
alex
Reply
Sawiyati
Reply
lpdourado
Reply
Hi!
I follow the tutorial, but when I try to test the configuration
openning another SSH connection, shows me a error message:
Network error: Connection timed out.
On Putty, I put the IP address of the CentOS server with 22000
port.
I already close the first SSH connection where I was logged
with root, thinking thats was the problem.
If you can help me with this.
Thanks.
Cory
Reply
eugene
http://www.servermom.org/basiccentossetupbeforebuildingaworkingserver/414/
Reply
11/25
5/14/2015
BasicCentOSSetupBeforeBuildingAWorkingServer
Sawiyati
RimaS
Reply
Sawiyati
Reply
http://www.servermom.org/basiccentossetupbeforebuildingaworkingserver/414/
12/25
5/14/2015
BasicCentOSSetupBeforeBuildingAWorkingServer
Cory
Reply
iptablesIINPUTptcpdportYOURPORT
NUMBERjACCEPT
Hope this helps someone.
Cory
Reply
iptablesIINPUTptcpdport
YOURPORTNUMBERjACCEPT
anonimo
Hilman
January 5, 2014
Reply
http://www.servermom.org/basiccentossetupbeforebuildingaworkingserver/414/
13/25
5/14/2015
BasicCentOSSetupBeforeBuildingAWorkingServer
Leoui
Reply
Leoui
Reply
Sawiyati
Reply
eugene
Reply
RImas
Reply
wisse
April 4, 2014
Reply
14/25
5/14/2015
BasicCentOSSetupBeforeBuildingAWorkingServer
Fernando Aguilar
April 7, 2014
Reply
Hendra
Reply
Great tutorial. this is my first time install Linux and all working
excellent.
btw what is the difference between using UseDNS yes and
UseDNS no
in /etc/ssh/sshd_config
Melsi
Reply
http://www.servermom.org/basiccentossetupbeforebuildingaworkingserver/414/
15/25
5/14/2015
BasicCentOSSetupBeforeBuildingAWorkingServer
predrag
Reply
June 1, 2014
predrag
June 1, 2014
Reply
ok, got it! ssh as new user and when in just type su
- and then roots pass and youre in, destroy the
damn thing whatever two stupid posts from me
but it will help some newbie like me :/
arline's mom
Reply
eljefe
Reply
16/25
5/14/2015
BasicCentOSSetupBeforeBuildingAWorkingServer
Sawiyati
Reply
Hrishi
Reply
Hrishi
Reply
Just one quick question. It seems I can login with the new user
perfectly fine but the new user does not seem to have root
privileges. I tried adding a new user from this new user login
and for certain things it kept saying you do not have enough
priviledges. How do I enable root login again?
Sawiyati
Reply
Bryan
Reply
Bob
http://www.servermom.org/basiccentossetupbeforebuildingaworkingserver/414/
Reply
17/25
5/14/2015
BasicCentOSSetupBeforeBuildingAWorkingServer
Thanks for all the time you have put into your work here.. As a
total newbie using your tutorials I am setting up my vps with
nginx and wordpress. Has been smooth and Im learning so
much along the way Again thanks
donjon
August 8, 2014
Reply
Sam.P
Reply
Ken
September 3, 2014
Reply
Brain_Out
September 6, 2014
Reply
Hank
http://www.servermom.org/basiccentossetupbeforebuildingaworkingserver/414/
Reply
18/25
5/14/2015
BasicCentOSSetupBeforeBuildingAWorkingServer
Hanif
Reply
Hi, i follow exactly you basic centos setup, i even check a new
user to make sure i can logon to it, but when i want to proceed
to install httpd, it said i dont have root permission. I already
disable root logon therefore i could not login using root
anymore, i cant even edit sshd_config to reenable root login.
Appreciate your help.
maxime
Reply
Sawiyati
Reply
19/25
5/14/2015
BasicCentOSSetupBeforeBuildingAWorkingServer
maxime
Reply
Vladan
Reply
javier
Reply
Thanks!
I follow your steps, but i got a big problem!
Now when i want login in putty, appear this:
Putty Fatal Error
Network Error: Connection refused
How can i resolve? Please help me!
Sawiyati
Reply
Anirudh Kanabar
Reply
20/25
5/14/2015
BasicCentOSSetupBeforeBuildingAWorkingServer
harikrishna
Reply
Kamal S. Prasad
Reply
Kamal S. Prasad
Reply
Hi,
I noticed I didnt have to open the new ports via iptables and
was still able to connect. Why is that?
Kamal
David
Reply
Jonathan
February 2, 2015
Reply
21/25
5/14/2015
BasicCentOSSetupBeforeBuildingAWorkingServer
Sawiyati
February 3, 2015
Reply
eric
March 5, 2015
Reply
Philip
Reply
Hi,
i cant run the command:
iptables -l INPUT -m state -state NEW -m tcp -p tcp -dport
22000 -j ACCEPT
i get the error:
[root@h2191522 ~]# iptables -l INPUT -m state -state NEW -m
tcp -p tcp dport 22000 -j ACCEPT
iptables v1.4.7: option `-l requires an argument
kaushal
Reply
22/25
5/14/2015
BasicCentOSSetupBeforeBuildingAWorkingServer
Alex
Reply
Caesar Louis
April 3, 2015
Reply
me2
Reply
Hi Sawiyati,
I have setup my server and able to view my site on my unit.
But, if I try to access the website thru internet, I cannot access
it though.
Thank You.
Alibaba
Reply
ADD A COMMENT
http://www.servermom.org/basiccentossetupbeforebuildingaworkingserver/414/
23/25
5/14/2015
BasicCentOSSetupBeforeBuildingAWorkingServer
Email Address:*
Website:
Comment:*
ADD COMMENT
Notify me of follow-up comments by email.
Notify me of new posts by email.
REVIEW
10 LOW END
5+ FREE SELF-
USEFUL FREE
http://www.servermom.org/basiccentossetupbeforebuildingaworkingserver/414/
RECOMMENDED
LIST OF FREE
24/25
5/14/2015
BasicCentOSSetupBeforeBuildingAWorkingServer
HOSTED SERVER
CLOUD SERVER
UPTIME
PROVIDERS
MONITORING
PROVIDERS
MONITORING
PROVIDERS FOR
SERVICES FOR
POINTING
YOUR SERVER
DOMAIN TO
TOOLS
DNS HOSTING
YOUR VPS
PARTNER US
http://www.servermom.org/basiccentossetupbeforebuildingaworkingserver/414/
PRIVACY POLICY
DISCLAIMER
25/25