sshd 2017-08-16 server server12345678910111213141516171819202122232425sudo apt-get install openssh-serverps ef|grep sshsudo /etc/init.d/ssh start 或者 service sshd start# 创建一个普通用户useradd usernamepasswd usernamevim /etc/ssh/sshd_config Port 22333 PermitRootLogin no TCPKeepAlive yes ClientAliveInterval 360 ClientAliveCountMax 20# 给普通用户附sudo权限chmod u+w /etc/sudoersvim /etc/sudoers root ALL=(ALL) ALL username ALL=(ALL) ALLchmod u-w /etc/sudoers/etc/init.d/ssh startservice sshd restartfirewall-cmd --permanent --add-port=22333/tcpfirewall-cmd --reload client1ssh -p 22333 username@ip SSH无密码登录123456789# client:生成SSH公钥ssh-keygen -t rsa -C "邮箱" # 将SSH公钥上传到Linux服务器ssh-copy-id -p 22 username@remote-server# 将client端的gedit ~/.ssh/id_rsa.pub的内容放到server端~/.ssh/authorized_keys# 等同于如下cat ~/.ssh/id_rsa.pub | ssh username@your_host \ "cat - >> /home/username/.ssh/authorized_keys" Newer 内容分发网络 Older shadowsocks