What is ssh?
SSH, or Secure Shell, is a protocol used to
securely log onto remote systems. It is the most common way to access remote Linux
and Unix-like servers.
ssh commands:
If your
username on the remote system is the same as your username on your local system:
#ssh remote_host
remote_host means ip
address or domain name that you are trying to connect to.
If
your username is different on the remote system, you can specify it by using
this syntax:
#ssh remote_username@remote_host
Edit
the configuration file of sshd
#vim
/etc/ssh/sshd_config
It may be a good idea to change
this to a non-standard port to help obscure your server from random port scans.
If you do change your port, we will show you how to connect to the new
port later on.
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_keyHostKey /etc/ssh/ssh_host_ecdsa_key
If you
are having difficulties with SSH, increasing the amount of logging may be a
good way to discover what the issue is.
LoginGraceTime 120 (LoginGraceTime specifies how many seconds to keep the connection
alive without successfully logging in.)
PermitRootLogin yes (PermitRootLogin
selects whether root is allowed to log in.)
StrictModes yes (strictModes is a safety guard that will refuse a login attempt if
the authentication files are readable by everyone.)
Determine if the SSH server
service sshd is running.
#service sshd status
If the SSH
server service sshd is not running, start this daemon.
#service sshd restart
If the service is running, no further action is required.#service sshd restart
Comments