[Linux]使用Mac连接Debian服务器的基础配置

配置连接服务器请参照:Linux服务器初步配置流程 Debian安装软件手册:Debian Manual Howto

安装Debian系统

镜像可以去华中科技大学镜像下载。

设置Debian下默认文本编辑器为VIM:

aptitude update
aptitude install vim
update-alternatives --config editor

修改Debian的/etc/apt/sources.list如下,防止提示插入介质

# deb http://http.debian.net/debian/ wheezy main contrib non-free
# deb http:ftp.jp.debian.org/debian sid main
# deb http://security.debian.org/ wheezy/updates main contrib
# deb http://ftp.debian.org/debian/ wheezy-updates main contrib
# deb-src http://ftp.debian.org/debian/ wheezy-updates main contrib
# deb-src http://security.debian.org/ wheezy/updates main contrib
deb http://mirrors.163.com/debian/ stable main
deb-src http://mirrors.163.com/debian/ stable main

给服务器的Debian系统安装SSH,这样其他电脑就能通过SSH连接

apt-get install openssh-server   
apt-get install ssh  

使用Mac生成SSH公钥和密钥

ssh-keygen  

给Mac电脑添加ssh-copy-id命令

sudo curl https://raw.githubusercontent.com/beautifulcode/ssh-copy-id-for-OSX/master/ssh-copy-id.sh -o /usr/local/bin/ssh-copy-idsudo   
chmod +x /usr/local/bin/ssh-copy-id  

将生成的公钥上传到服务器

ssh-copy-id whyadmin@222.22.222.222  

ssh连接Debian出现warning: Falling back to the standard locale ("C")

// 1.在/home/your-login/.bashrc里面添加:  
export LC_ALL=C  
// 2. 运行:  
source ~/.bashrc  

配置SSH的config文件,以后直接用ssh host1连接

Host host1
HostName 222.222.222.22  
User why  
Port 1223

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值