Changes

Jump to: navigation, search

OPS235 Lab 7 - CentOS7 - HD2

3 bytes added, 07:04, 3 November 2016
no edit summary
# For this section, you will still be using your '''c7host''' and '''centos1''' VMs.<br><br>The next change you can make is to prevent the root account from logging in to sshd altogether.<br><br>
# Change to your '''centos1''' VM and open a terminal.
# Edit the file '''/etc/ssh/sshd_config''' and look for the option <b><code><span style="color:#3366CC;font-size:1.2em;">PermitRootLogin</span></code></b>. <u>'''<br>Un-comment the option'''</u> (or add the option if it does not appear) and change the option value to <b><code><span style="color:#3366CC;font-size:1.2em;">no</span></code></b>.<br><br>'''NOTE:''' Now any hacking attempt also has to guess an account name as well as the password. <br>If you need to ssh with root access, ssh as a regular user and use '''su -''' to become root.<br><br>
# Even better, it is possible to restrict access to just specific users that require it:<br>Edit the file '''/etc/ssh/sshd_config''' and add a new option of <b><code><span style="color:#3366CC;font-size:1.2em;">AllowUsers account</span></code></b> using '''your''' login account for account<br>
# In order for these changes to take affect, you need to restart the sshd daemon. Issue the following command to restart the '''sshd''' service:<br /><b><code><span style="color:#3366CC;font-size:1.2em;">systemctl restart sshd</span></code></b>
13,420
edits

Navigation menu