Basic CentOS Setup Before Building a Working Server

Embed Size (px)

Citation preview

  • 7/25/2019 Basic CentOS Setup Before Building a Working Server

    1/25

  • 7/25/2019 Basic CentOS Setup Before Building a Working Server

    2/25

    practices of initial server setup. This is aimed to tweak and apply

    some basic security protection on your server and make it real

    private. For instance, to change default root login, change default

    SSH port and so on.

    Following all steps in this initial CentOS server setup is not a must

    but strongly recommended. However the decision is up to you. I

    assumed you have either VPS or Dedicated server already so you

    can follow this guide.

    In this example, I use a VPS with 512Mb of RAM running CentOS

    6.3 x32 located in Amsterdam hosted by DigitalOcean.

    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

    fingerprint. Dont panic and simply hit Yes.

    Step 2 Change default password for root. Sometimes a VPS or

    HOW TO ADD

    NEW WEBSITE

    ON VESTA CP

    84 Comments

    BASIC CENTOSSETUP BEFORE

    BUILDING A

    WORKING

    SERVER

    72 Comments

    HOW TO ADD

    NEW SITE

    INTO YOURAPACHE-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

    http://www.servermom.org/build-ubuntu-server-a-complete-guide/http://www.servermom.org/node/digitaloceanhttp://www.servermom.org/how-to-add-new-site-into-your-apache-based-centos-server/454/http://www.servermom.org/add-new-website-vesta-cp/1066/http://-/?-http://www.servermom.org/top-most-used-common-ssh-commands/56/http://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/http://www.servermom.org/install-vestacp-centos-6-5-vps/1050/http://www.servermom.org/install-vestacp-centos-6-5-vps/1050/http://www.servermom.org/add-new-website-vesta-cp/1066/http://www.servermom.org/wp-content/uploads/2013/03/login-putty.jpghttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/http://www.servermom.org/complete-newbie-guide-to-build-centos-server-to-host-websites/http://www.servermom.org/how-to-build-openvpn-server-on-centos-6-x/732/http://www.servermom.org/how-to-add-new-site-into-your-apache-based-centos-server/454/http://www.servermom.org/using-putty-to-ssh-to-your-server-from-windows/46/http://www.servermom.org/how-to-build-openvpn-server-on-centos-6-x/732/
  • 7/25/2019 Basic CentOS Setup Before Building a Working Server

    3/25

    server is created using random password generated by the

    providers management software. It is good practice to change it to

    something easier to remember by you but hard to crack or guess

    by others. Use this command syntax:

    Youll then be asked to enter your new password twice.

    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 isreally a standard username hackers can easily guess. Its just like

    admin or administrator in Windows. Use command below to

    create new username:

    *change newuser above with your own new username. In this

    example I use my name sawiyati.

    Then issue this command to setup password for that user:

    Upon hitting Enter on your keyboard your server will ask you to

    type the password for that user.

    1 passwd

    1 /usr/sbin/addusernewuser

    1 passwdnewuser

  • 7/25/2019 Basic CentOS Setup Before Building a Working Server

    4/25

    Step 4 Setup root privileges to that userso once you logged in

    to your server using that new user you will still be able to perform

    any root only tasks. To do that simply issue this command:

    then look for the line / section called:

    or in different CentOS release it may also like this:

    Then add this line right after the root line:

    ## Allow root to run any commands anywhere

    root ALL=(ALL) ALL

    newuser ALL=(ALL) ALL

    it should look like this:

    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

    1 /usr/sbin/visudo

    12

    # User privilege specificationroot ALL=(ALL) ALL

    12

    ## Allow root to run any commands anywhereroot ALL=(ALL) ALL

  • 7/25/2019 Basic CentOS Setup Before Building a Working Server

    5/25

    sshd_config filewhich is the main configuration file of SSH service

    in your server. You can either use vi or Nano to edit it. In this

    example I use Nano editor:

    Then fine following lines:

    Remove the #symbol and change the 22 (it is default port) to to

    any number between 1025 and 65536, For example is port 22000.

    Example:

    Next, also find:

    Remove the # symbol and change yes to no

    PermitRootLogin no

    So it will look like this:

    Next, find this line as well:

    Remove the # symbol and change yes to no

    1 nano /etc/ssh/sshd_config

    1 #port 22

    1 port 22000

    1 #PermitRootLogin yes

    1 #UseDNS yes

  • 7/25/2019 Basic CentOS Setup Before Building a Working Server

    6/25

    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:

    Of course you have to replace newuser with your own username

    created in the step 3 above. Example:

    Once done, hit Control+O to save then Control+X to exit Nano

    editor.

    Step 7 Reload SSH service. To make sure the new configuration

    is used by the service, simply reload SSH by using this command:

    It should return with the OK message.

    Step 8 Give it a try! I assumed currently you are still logging in as

    root. Dont close that SSH session yet before you test it and make

    sure all the settings you defined in SSH config file really works.

    Now launch another Terminal window or launch another Putty

    1 AllowUsers newuser

    1 /etc/init.d/sshdreload

  • 7/25/2019 Basic CentOS Setup Before Building a Working Server

    7/25

    HOW TO ADD NEW

    WEBSITE ON

    KLOXO-MR CP

    9 Comments | Oct 3, 2014

    CONNECTING YOUR

    SERVER WITH YOUR

    DOMAIN USING

    FREE DNS MANAGER

    15 Comments | Mar 29, 2013

    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

    RELATED POSTS

    Sawiyati

    Hi! I'm Sawiyati, a mom with passion

    about blogging, programming and

    everything techy. Having no offline job,

    so I decided to start blogging while

    learning what I love for. You can find me at Google+ here.

    ABOUT THE AUTHOR

    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:

    Facebook 32 Twitter 2 Google Reddit

    http://www.servermom.org/basic-security-setup-centos-web-panel/2036/#commentshttp://www.servermom.org/connecting-your-server-with-your-domain-using-free-dns-manager/512/http://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?share=facebook&nb=1http://www.servermom.org/add-new-website-kloxo-mr/1876/#commentshttp://www.servermom.org/zpanelx-cp-v10-1-1/1300/http://www.servermom.org/basic-security-setup-centos-web-panel/2036/http://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?share=twitter&nb=1http://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?share=reddit&nb=1http://www.servermom.org/connecting-your-server-with-your-domain-using-free-dns-manager/512/#commentshttps://plus.google.com/107532637822321544224http://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?share=google-plus-1&nb=1http://www.servermom.org/add-new-website-kloxo-mr/1876/http://www.servermom.org/zpanelx-cp-v10-1-1/1300/#comments
  • 7/25/2019 Basic CentOS Setup Before Building a Working Server

    8/25

    72 COMMENTS

    hi/

    Really helpful

    Thanks

    Replysaeed June 21, 2013

    Thanks be blessed,,,,,,i am a newbie in Centos,

    thanks for the well detailed tutorial

    ReplyTendai Afrika March 13, 2015

    A very well detailed tutorial. Thank you. I am trying out my

    hands on linux for the first time and your tutorial was both

    very well illustrated and helpful.

    ReplySiddeswara July 3, 2013

    Glad to know it is helpful

    ReplySawiyati July 6, 2013

    it seems that the most basic thing is missing; how to actually

    install the OS itself, that I cannot find?? I am interested in

    learning how to install a centos LAMP from the netinstall to

    run headless.

    A tutorial on that would be great! I love the other stuff that you

    have in your blog. it is the most comprehensive and well

    written, easy to understand blog I have ever come across. A lot

    of sites assume the user already knows the commands to edit

    ReplyNeville Scollop July 13, 2013

    http://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=147641#respondhttp://www.zeklink.de/http://rajahmundryonline.com/http://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=565#respondhttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=701#respondhttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=642#respondhttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=655#respond
  • 7/25/2019 Basic CentOS Setup Before Building a Working Server

    9/25

    and save configs, you dont make that assumption and I love it

    for that!

    Hi Neville, usually, most VPS providers are already

    installed the OS of your choice during setup. So it is

    ready-to-use. Well, some providers also provide

    their users with VPS control panel where users can

    re-install OS from there

    ReplySawiyati July 16, 2013

    hello in the begining id like to thank you

    for your efforts making such beautiful

    tutorial, can you please explain how do

    we install the os because some of the

    viewers are setting there own home web

    servers at home for personal websites

    and dont know how to install it or set and

    config there ip addressesthx alot

    ReplyAli Douglah May 20, 2014

    very nice, i have learn something new today

    bookmarked

    Replyabu July 20, 2013

    Thanks for your Tut madame. but i have problems

    Why I get error after doing this, when I open putty and access

    my server to the new port I configured.

    ReplyCyrus August 2, 2013

    http://13mr.me/http://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=7750#respondhttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=961#respondhttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=775#respondhttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=734#respond
  • 7/25/2019 Basic CentOS Setup Before Building a Working Server

    10/25

    Network Error: Connection timed out.,,

    Thanks for this great and clear tutorial for a VPS beginner like

    me!

    ReplyDaniel August 16, 2013

    This is a great tutorial, thank-you heaps.

    ReplyNathan September 1, 2013

    You forgot to mention that they need to allow the new ssh port

    through iptables.

    ReplyVirtual October 2, 2013

    thanks

    ReplySawiyati October 5, 2013

    Yes, it worked great AFTER setting up iptables!

    These are really great tutorials. I wish you had

    social media links so I could share them easier.

    ReplyJim October 26, 2014

    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

    ReplyForo Ovnis October 11, 2013

    http://jimheil.com/http://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=1718#respondhttp://www.ovnis.me/http://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=1127#respondhttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=56216#respondhttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=1738#respondhttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=1767#respondhttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=1298#respond
  • 7/25/2019 Basic CentOS Setup Before Building a Working Server

    11/25

    computer crashes while theyre working on it. Thanks!

    Very understandable , i am just a begginer user of vps and I

    could do it thanks a lot.

    Replyalex November 10, 2013

    Glad you liked it

    ReplySawiyati November 12, 2013

    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.

    Replylpdourado November 19, 2013

    Open your ports in iptables. See my original

    comment.

    ReplyCory November 28, 2013

    Replyeugene March 10, 2014

    http://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=3425#respondhttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=2001#respondhttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=2093#respondhttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=1983#respondhttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=2188#respond
  • 7/25/2019 Basic CentOS Setup Before Building a Working Server

    12/25

    Yes, but if you closed the default root ssh

    connection, you cant run commands

    anymore. What have I done!? Please help

    me.

    You should follow all procedure

    correctly. Also do not close

    current ssh session while trying to

    establish new ssh session to test

    new username

    Reply

    Sawiyati March 11, 2014

    About itables its true, dont forget! Anyway, I am confused. If

    you disable root account and use just other one with su

    priveleges to connect withh ssl, you leave the port open. If you

    close ssh port as root, you cant enable ssh with su or I am not

    right?

    ReplyRimaS November 20, 2013

    Just use another port. If it is closed then open that

    port first while you can leaving default port (22)

    open or closed thats up to you but you better

    close any unnecessary ports. Anyway, this is just a

    very basic security setup to avoid kiddies

    bruteforcing your server, not total protection but at

    least slow em down. For advanced protection then

    youll need advanced security setup.

    ReplySawiyati November 28, 2013

    http://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=2186#respondhttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=2108#respondhttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=3438#respond
  • 7/25/2019 Basic CentOS Setup Before Building a Working Server

    13/25

    I was getting connection time outs until I manually opened the

    port in iptables using the following command:

    Hope this helps someone.

    ReplyCory November 21, 2013

    iptables -I INPUT -p tcp dport YOUR-PORT-

    NUMBER -j ACCEPT

    Theres two dashes before dport. Correction:

    ReplyCory November 21, 2013

    iptables -I INPUT -p tcp -dport

    YOUR-PORT-NUMBER -j ACCEPT

    this should be added to the very end of

    the tutorial in red big capital letters, so

    people who are learning understand

    better the all configuration process,

    regards and thanks.

    Replyanonimo October 17, 2014

    Sweet. Thanks dude!

    ReplyHilman January 5, 2014

    http://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=2670#respondhttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=40761#respondhttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=2119#respondhttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=2118#respond
  • 7/25/2019 Basic CentOS Setup Before Building a Working Server

    14/25

    Makasi banyak Tante.. Thats really helps..

    ReplyLeoui February 11, 2014

    btw, i got this error note, Tan..

    mkdir: cannot create directory /var/www': Permission denied

    ReplyLeoui February 11, 2014

    you should login as root or user with root privilege

    ReplySawiyati February 12, 2014

    I cant $ su from the newly created user.

    I fixed the issue with $ chmod 4755 /bin/su , is this ok

    security wise ?

    Replyeugene March 10, 2014

    It is very bad mate.

    ReplyRImas March 11, 2014

    Thank you for the tutorial,

    Logging in from ssh works good with the new user, theres only

    one problem i have right now: as soon as i try to acces the

    Replywisse April 4, 2014

    http://www.lewiverdatama.com/http://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=3664#respondhttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=3122#respondhttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=3133#respondhttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=3433#respondhttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=3437#respondhttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=3123#respondhttp://www.lewiverdatama.com/
  • 7/25/2019 Basic CentOS Setup Before Building a Working Server

    15/25

    /usr/sbin/visudo along with some other folders with root acces

    i cannot acces it. When trying to acces the file i get this error:

    visudo /etc/sudoers permission denied

    I followed every step in your tutorial and i cannot figure out

    why it does not work . Does anyone have this same problem or

    does anyone know a good solution?

    Thanks,

    Wisse

    Thanks for this guide.It has been very helpful to me and I learned something very

    important today.

    ReplyFernando Aguilar April 7, 2014

    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

    ReplyHendra April 16, 2014

    Luckily I followed the advice not to close the current

    connection until testing is ok. Changing the port takes more

    steps than editing the sshd_config, so one should be very

    carefull with this in order not to lock him self out of the

    system.

    ReplyMelsi May 16, 2014

    http://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=3777#respondhttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=6819#respondhttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=3689#respondhttp://sinwa.co.id/
  • 7/25/2019 Basic CentOS Setup Before Building a Working Server

    16/25

    I just fckdup my new entos install with this guideAs a new

    user I cant install nothing not a sudoer not a sh!t. How am Igoing to reverse these changes since I screw up denying root

    to ssh????

    Replypredrag June 1, 2014

    ok, got it! ssh as new user and when in just type su

    - and then roots pass and youre in, destroy thedamn thing whatevertwo stupid posts from me

    but it will help some newbie like me :/

    Replypredrag June 1, 2014

    thanks for the tutorial. I was greatly helped. I am also looking

    for the same tutorial for debian OS. hopefully I also find ithere.

    Replyarline's mom June 10, 2014

    I followed the directions on a server I setup on a digital

    hosting website. After creating the user, and after altering the

    necessary files, when I try to log-in via ssh with the new user, I

    get a connection refused message.

    What did I do wrong? I just edited iptables and included port

    22 and 22000, but still the connection is refused. I made sure

    ssh and iptables both reloaded, and were running, and still no

    connection allowed.

    (Fortunately, Im still connection via root.)

    Replyeljefe June 12, 2014

    http://x-arena.com/http://x-arena.com/http://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=10767#respondhttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=10763#respondhttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=12426#respondhttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=12795#respond
  • 7/25/2019 Basic CentOS Setup Before Building a Working Server

    17/25

    What am I doing wrong?

    make sure you edit /etc/ssh/sshd_config and add to

    allow the new user (step 6)

    ReplySawiyati June 12, 2014

    Thanks a ton! Im very new to setting up my own server and

    this is really useful information

    ReplyHrishi June 29, 2014

    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?

    ReplyHrishi June 29, 2014

    you can always add sudo in every command you

    want. Or, you can simply type su to switch login

    as root user.

    ReplySawiyati June 30, 2014

    Thank you so much, I get it done easily..

    ReplyBryan July 22, 2014

    ReplyBob July 29, 2014

    http://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=15488#respondhttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=15360#respondhttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=15356#respondhttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=18539#respondhttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=12801#respondhttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=21627#respond
  • 7/25/2019 Basic CentOS Setup Before Building a Working Server

    18/25

    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 wayAgain thanks

    mbaknya indonesia ya? lg bingung nih setup vps unmanaged

    saya

    Replydonjon August 8, 2014

    Same problem than a lot of usDont have root privileges on

    my user account, but it tells I have root privileges when doing

    sudo -l.

    if someone can help

    ReplySam.P August 12, 2014

    Tks for the nice tutorial.

    I have one questions. when I upload the files by SFTP, it always

    says : Permission denied

    Please help.

    Tks

    ReplyKen September 3, 2014

    THANKS for this!!!

    Really Helpfull

    ReplyBrain_Out September 6, 2014

    ReplyHank September 19, 2014

    http://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=34175#respondhttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=26428#respondhttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=35783#respondhttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=33655#respondhttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=27467#respond
  • 7/25/2019 Basic CentOS Setup Before Building a Working Server

    19/25

    Excellent tutorials! Unfortunately,I set up my Digital Ocean VPS

    without changing my ssh port. I also installed fail2ban.

    Everything works.

    When I now change the port number in the sshd config file

    and in Putty to a non-standard port, I can no longer connect

    with Putty.

    I suspect I must do something with iptables and fail 2 ban as

    well to make this work.

    Could you suggest how I could make this change?

    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.

    ReplyHanif September 26, 2014

    Truc sudo yum install httpd or su root yum install

    httpd.it Williams as si you for the root password

    and let you install httpd.

    Hope this helps

    Replymaxime September 26, 2014

    there are two options:

    First, you can switch from current user to root by

    typing suhit Enter then type password for root.

    Another option is to use sudoprefix in each / every

    command that needs root privilege (eg: sudo yum

    install httpd). I hope that helps.

    ReplySawiyati September 26, 2014

    http://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=36727#respondhttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=36730#respondhttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=36698#respond
  • 7/25/2019 Basic CentOS Setup Before Building a Working Server

    20/25

    Damn autocorrection on french mobile.please remove

    previous comment

    Replymaxime September 26, 2014

    Why you didnt mentioned that we need to change ports in

    iptables!!! Now i cant access to my vps!

    ReplyVladan October 19, 2014

    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!

    Replyjavier October 20, 2014

    That most likely because Putty uses different port

    as what you defined on your vps

    ReplySawiyati October 23, 2014

    I followed this tutorial. You forgot to mention about the

    iptables. So now I exited it without adding it to the iptables. I

    only have the ipaddress and password of the server. There is

    no online control panel for it.

    Now I cant login to it via PuTTy. Could someone help me?

    ReplyAnirudh Kanabar November 12, 2014

    http://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=81606#respondhttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=48440#respondhttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=43094#respondhttp://digitalmachine.in/http://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=36729#respondhttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=43877#respond
  • 7/25/2019 Basic CentOS Setup Before Building a Working Server

    21/25

    i have one doubt.cent os install normal home pc .its possible

    or not.please tell me

    Replyharikrishna November 21, 2014

    In CENTOS 7, the command to reload SSH service is:

    service sshd restart

    at least, it is on the VPS, I was using.

    ReplyKamal S. Prasad January 17, 2015

    Hi,

    I noticed I didnt have to open the new ports via iptables and

    was still able to connect. Why is that?

    Kamal

    ReplyKamal S. Prasad January 24, 2015

    Some vendors leave higher ports than 1024 open

    by default, you can know more about your open

    ports using netstat -an

    ReplyDavid February 16, 2015

    Hello, im newbie in Linux, and im stuck at Step 1: Login to

    your remote server via SSH connection.

    I dont have a remote server, i want to set the server on my pc,

    so what should i do?

    ReplyJonathan February 2, 2015

    http://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=143792#respondhttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=142717#respondhttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=93094#respondhttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=145352#respondhttp://kamalprasad.com/http://kamalprasad.com/http://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=141709#respondhttp://hitekcom.mx/http://www.hericxhub.com/
  • 7/25/2019 Basic CentOS Setup Before Building a Working Server

    22/25

    you can skip that step if you just want to do this on

    local pc

    ReplySawiyati February 3, 2015

    I did everything except keeping the ssh port unchanged, but

    putty shows Connection refused error. I now cant login. Any

    help?

    Replyeric March 5, 2015

    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

    ReplyPhilip March 17, 2015

    Ive tried to replicate exactly the same steps on a fresh CENTOS

    VPS server and the connection via the new user fails every time

    I tried to login from my Mac terminal. After some debugging, I

    found this is happening due to change of default port to

    22000. Besides the steps mentioned above, is there anything

    else I need to do to make sure my connections recognise port

    22000? When I revert the post to 22, I can login with my new

    Replykaushal March 24, 2015

    http://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=143819#respondhttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=148157#respondhttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=147873#respondhttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=147061#respond
  • 7/25/2019 Basic CentOS Setup Before Building a Working Server

    23/25

    ADD A COMMENT

    username and password. Unfortunately not when I change the

    port form 22 to 22000.

    It would be best to use certificate instead of obfuscating

    access. Just enable login only by certificate and you are set

    ReplyAlex March 27, 2015

    when Im trying to ssh client, its always asking for root

    password. can you help me to solve this?

    ReplyCaesar Louis April 3, 2015

    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.

    Replyme2 April 27, 2015

    For some reason I cant install the nano

    Reconfigure the baseurl/etc. for the repository, to point to aworking upstream.

    ReplyAlibaba May 13, 2015

    http://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=149519#respondhttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=148607#respondhttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=148322#respondhttp://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/?replytocom=150134#respond
  • 7/25/2019 Basic CentOS Setup Before Building a Working Server

    24/25

    Your email address will not be published. Required fields

    are marked *

    Name:*

    Email Address:*

    Website:

    Comment:*

    ADD COMMENT

    Notify me of follow-up comments by email.

    Notify me of new posts by email.

    10 LOW END 5+ FREE SELF- 15+ LOW END USEFUL FREE RECOMMENDED LIST OF FREE

    REVIEW

    http://www.servermom.org/recommended-vps-3-crissic/1151/http://www.servermom.org/free-self-hosted-server-monitoring-tools/1824/http://www.servermom.org/free-dns-hosting/1036/http://www.servermom.org/low-end-cloud-server-providers/1577/http://www.servermom.org/low-end-nat-ipv4-vps-providers/2094/http://www.servermom.org/useful-free-uptime-monitoring-services-server/1175/
  • 7/25/2019 Basic CentOS Setup Before Building a Working Server

    25/25

    NAT IPV4 VPS

    PROVIDERS

    HOSTED SERVER

    MONITORING

    TOOLS

    CLOUD SERVER

    PROVIDERS

    UPTIME

    MONITORING

    SERVICES FOR

    YOUR SERVER

    VPS #3: CRISSIC DNS HOSTING

    PROVIDERS FOR

    POINTING

    DOMAIN TO

    YOUR VPS

    COPYRIGHT 2015 SERVERMOM.

    CONTACT US PARTNER US PRIVACY POLICY DISCLAIMER

    http://www.servermom.org/recommended-vps-3-crissic/1151/http://www.servermom.org/partner-us/http://www.servermom.org/contact-us/http://www.servermom.org/free-self-hosted-server-monitoring-tools/1824/http://www.servermom.org/free-dns-hosting/1036/http://www.servermom.org/low-end-cloud-server-providers/1577/http://www.servermom.org/privacy-policy/http://www.servermom.org/http://www.servermom.org/http://www.servermom.org/low-end-nat-ipv4-vps-providers/2094/http://www.servermom.org/useful-free-uptime-monitoring-services-server/1175/http://www.servermom.org/disclaimer/