Disabling SSH login for root user
- Edit /etc/ssh/sshd_config
- Set PermitRootLogin to no (Remove # if present)
- Add AllowUsers
- Save, then restart sshd:
$ service sshd restart
Setup Passwordless SSH:
- Create SSH keypair with options, such as:
$ ssh-keygen -b 5120 - chmod created keypair:
$ chmod 600 - SCP the public key to target machine.
- On target machine:
$ mkdir ~/.ssh$ chmod 700 ~/.ssh - If ~/.ssh/authorized_keys doesn't exist:
move the public key from home folder to ~/.ssh/authorized_keys then
$ chmod 600 ~/.ssh/authorized_keys - If it does exist, then append the public key to the authorized_keys:
$ cat>> ~/.ssh/authorized_keys , then delete the public key. - Test by SSHing to the target machine
Editing Hostnames
- Edit /etc/sysconfig/network. modify HOSTNAME= to FQDN
- Edit /etc/hosts. Add IP address with FQDN and shortname
- Restart network services:
$ /etc/init.d/network restart
No comments:
Post a Comment