Ubuntu安装sshd服务

ubuntu安装ssh服务

一、安装shhd

SSH分客户端openssh-clientopenssh-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的服务端口,默认端口是22,你可以自己定义成其他端口号,如222。
然后重启SSH服务:

sudo /etc/init.d/ssh stop
sudo /etc/init.d/ssh start

然后使用以下方式登陆SSH:

ssh [email protected] 

tuns为192.168.0.100机器上的用户,需要输入密码。
断开连接:exit

二、遇到的问题

ubuntu安装open-server时出现问题

时间:2020年04月28日12:21:36


-end-

你可能感兴趣的:(linux)