SSH-Security Shell
SSH远程登录Meth:ssh user_name@remotehost/hostname
SSH加密–公钥和私钥(非对称加密)
Ssh运作方式:通过public-key去加密。servers 发送 公钥给client,公钥将会保存在client的~/.ssh/know_hosts 文件里面。匹配成功,直接登录。如果公钥不匹配,将会断开连接。Server的公钥保存在/etc/ssh/ssh_host_key里面。
1.ssh-keygen 将会生成公私钥,保存在家目录the private key ~/.ssh/id_rsa(600) and the publickey~/.ssh/id_rsa .pub . (644)
2.ssh-copy-id root@desktopX 默认传递~/.ssh/id_rsa.pub文件。
openSSH 配置方式
配置文件/etc/ssh/sshd_config,
将PermitRootLogin 改成no ,重启服务后将不允许root用户登录
另外一个
将不允许通过密码登录。
w -f查看谁在登录
利用pkill -SIGKILL -t terminal_name 踢出。