VMWare安装的ubuntu19.04设置22端口远程连接

个人博客:小景哥哥

VMWare安装的ubuntu19.04设置22端口远程连接

一、安装openssh-server

sudo su
apt install openssh-server

二、查看ssh服务

jason@ubuntu:~/Desktop$ ps -e | grep ssh
   720 ?        00:00:00 sshd
  1638 ?        00:00:00 ssh-agent
  1715 ?        00:00:00 sshd
jason@ubuntu:~/Desktop$ service sshd status
   ssh.service - OpenBSD Secure Shell server
   Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enab
   `Active: active (running)`since Thu 2019-10-03 00:47:55 PDT; 2min 36s ago
     Docs: man:sshd(8)
           man:sshd_config(5)
  Process: 711 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
 Main PID: 720 (sshd)
    Tasks: 1 (limit: 2302)
   Memory: 4.6M
   CGroup: /system.slice/ssh.service
           └─720 /usr/sbin/sshd -D

Oct 03 00:47:54 ubuntu systemd[1]: Starting OpenBSD Secure Shell server...
Oct 03 00:47:55 ubuntu sshd[720]: Server listening on 0.0.0.0 port 22.
Oct 03 00:47:55 ubuntu sshd[720]: Server listening on :: port 22.
Oct 03 00:47:55 ubuntu systemd[1]: Started OpenBSD Secure Shell server.
Oct 03 00:48:24 ubuntu sshd[1715]: Accepted password for root from 172.16.170.1 
Oct 03 00:48:24 ubuntu sshd[1715]: pam_unix(sshd:session): session opened for us
lines 1-18/18 (END)

三、设置root远程登录

sudo vim /etc/ssh/sshd_config

将PermitRootLogin 设置为 yes

PermitRootLogin yes

若需要可以设置root密码

sudo passwd root

重启ssh即可

sudo service ssh restart

四、远程连接测试

ssh root@172.16.170.130
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

勤奋的凯尔森同学

你的鼓励将是我创作的最大动力!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值