linux学习(2)远程登录

远程登录:

推荐使用工具:putty win下的话可以使用xshell
ubuntu:sudo apt install putty:安装putty
centos:yum install -y openssh-clients:安装openssh-client

关闭防火墙:

1.#setenforce 0
2.#vi /etc/selinux/config
SELINUX=enforcing———>SELINUX=disabled

添加环境变量:export PATH=~/mypath/bin:$PATH

重启网络

service network restart 重启网络

ubuntu设置可以被远程

sudo apt-get install openssh-server安装openssh-server
ps -e |grep ssh查看是否启动ssh
如果没有则sudo /etc/init.d/ssh start
ssh [email protected] 其中anan是我的用户名,127.0.0.1是通用的本机ip。

vm12中克隆centos

init 0 :关闭centos
centos——>manage——>clone

这里可以设置多个电脑相互连接。

修改sshd的默认端口:
vi /etc/ssh/ssh_config
#port 22————>改为你需要的端口号

你可能感兴趣的:(linux学习(2)远程登录)