@TOC
使用xshell通过ssh登陆ubuntu时,提示需要创建密钥,建立公钥和私钥,然后同步到服务端再认证,非常的麻烦。
SSH登陆有口令方式和密钥方式,这里使用口令方式,免去密钥的麻烦。
1 安装SSH服务
sudo apt-get install openssh-server
2 启动SSH服务
sudo /etc/init.d/ssh start
3 配置口令登陆
- SSH服务默认使用22端口,这里可以改成50022端口,避免冲突。
- SSH服务默认开启密钥认证,这里改成yes,使用密码验证。
sudo vim /etc/ssh/sshd_config
# $OpenBSD: sshd_config,v 1.101 2017/03/14 07:19:07 djm Exp $
# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.
# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options override the
# default value.
Port 50022
# To disable tunneled clear text passwords, change to no here!
PasswordAuthentication yes
4 重启SSH服务
sudo /etc/init.d/ssh restart