0
点赞
收藏
分享

微信扫一扫

ssh远程连接try1&账号切换tips

木樨点点 2024-09-19 阅读 16
ssh运维

1,创建拥有sudo权限的用户:

在root下

sudo adduser bio
sudo vim /etc/sudoers 
//修改添加如下:
bio ALL=(ALL) ALL  
//bio用户就拥有了root权限

参考:https://github.com/isLishude/blog/issues/70

2,修改ssh配置

vim /etc/ssh/sshd_config

//主要修改以下键值对,注意去掉前面的#即可
PermitRootLogin yes
//且开放端口port 22

service sshd restart  //重启服务器

参考:https://www.cnblogs.com/onestarlearner/p/17599798.html

3,查看IP:

hostname -I // 或 ifconfig | grep inet 一般第3行第1列即可

查看https://blog.csdn.net/leviopku/article/details/119993323

4,使用mobaxterm进行ssh:
root+IP查看

另外切换账号的一些tips:
1,切换到root:

su root

2,root切换到其他:

su xxx

举报

相关推荐

0 条评论