ssh远程连接ArchLinux
我的Arch Linux系统虽然配色看上去很炫,但是中文有字体发虚的现象,以及vim的文字配色太暗,整体字体又小,看文字久了很累。所以还是用本机的终端ssh远程连接Arch最舒服。
1. 安装openssh
要想让Arch支持ssh连接首先得安装openssh服务,执行命令
1 | pacman -S openssh |
安装完openssh服务之后,首先查看sshd状态
1 | systemctl status sshd.service |
2. 启动sshd服务
如果未开启的话,需要启动sshd命令,执行命令
1 | systemctl start sshd |
但是遇到报错
Failed to start sshd.service: The name org.freedesktop.PolicyKit1 was not provided by any .service files
解决办法是使用sudo
来执行即可。默认监听22端口。
如果想要将sshd命令开机启动的话,同样需要root权限执行
1 | systemctl enable sshd.service |
3. 查看Arch IP地址
查看Arch Linux系统的ip地址,执行命令
1 | ip addr |
4. ssh远程连接
最后本机ssh远程连接即可
1 | ssh user@ip |
注意,我没有使用root权限登录,因为Arch默认禁止通过ssh进行root用户登录,但是可以修改配置文件来实现,具体参考Secure Shell这篇文章里的Server usage
内容。