
开启ssh服务
- 查看是否安装ssh服务:
ps -e | grep ssh
- 安装ssh服务:
sudo apt-get install ssh
mac终端ssh连接Linux虚拟机:
ssh user@remote[ip]
为了方便使用别名sshubt登陆
- 编辑mac下.bash_profile文件(需要root权限):
sudo vi ~/.bash_profile
- 添加下面语句
alias sshubt='ssh myusername@192.168.0.0'
- 使用别名sshubt,输入连接到的Linux主机密码,登陆即可
jockie:~$ sshubt johnathon@192.168.140.128's password: Welcome to Ubuntu 16.04.2 LTS (GNU/Linux 4.8.0-36-generic x86_64)
mac上传文件址Linux虚拟机
scp ~/local/file user@remtoe:~/file
~/local/file: mac文件路径
user@remote:~/file: 服务器文件路径