ubuntu开启SSH服务

SSH分客户端openssh-client和openssh-server
假设你仅仅是想登陆别的机器的SSH仅仅须要安装openssh-client(ubuntu有默认安装,假设没有则sudo apt-get install openssh-client),假设要使本机开放SSH服务就须要安装openssh-server
sudo apt-get install openssh-server
然后确认sshserver是否启动了:
ps -e |grep ssh
假设看到sshd那说明ssh-server已经启动了。
假设没有则能够这样启动:sudo /etc/init.d/ssh start
ssh-server配置文件位于/ etc/ssh/sshd_config,在这里能够定义SSH的服务port,默认port是22,你能够自定义成其它port号,如222。
然后重新启动SSH服务:
sudo /etc/init.d/ssh stop
sudo /etc/init.d/ssh start
然后使用下面方式登陆SSH:
ssh username@192.168.1.200 username为192.168.1.200 机器上的用户,须要输入password。

原文地址:https://www.cnblogs.com/lxjshuju/p/7008208.html