ArchLinux

把ArchLinux装起来了。(其中用到了163.镜像源)

安装好之后,发现没有ssh服务。

 1、需要安装ssh服务

 1.1 pacman -Sy openssh          --安装程序是pacman,不是 apt-get 或 yum

 1.2 编辑 /etc/ssh/sshd_config,把#PermitRootLogin prohibit-password 改为 PermitRootLogin yes   

 1.3 启动服务 systemctl start sshd  --用的服务管理程序 systemd服务来代替daemon

原本在/etc/init.d/目录下的启动文件,被/lib/systemd/system/下相应的文件所取代
daemon命令	systemctl命令	说明
service [服务] start	systemctl start [unit type]	启动服务
service [服务] stop	systemctl stop [unit type]	停止服务
service [服务] restart	systemctl restart [unit type]	重启服务

设置开机启动/不启动
daemon命令	systemctl命令	说明
chkconfig [服务] on	systemctl enable [unit type]	设置服务开机启动
chkconfig [服务] off	systemctl disable [unit type]	设备服务禁止开机启动

systemctl命令	说明
systemctl	列出所有的系统服务
systemctl list-units	列出所有启动unit
systemctl list-unit-files	列出所有启动文件
systemctl list-units –type=service –all	列出所有service类型的unit
systemctl list-units –type=service –all grep cpu	列出 cpu电源管理机制的服务
systemctl list-units –type=target –all	列出所有target

systemctl命令	说明
systemctl is-active [unit type]	查看服务是否运行
systemctl is-enable [unit type]	查看服务是否设置为开机启动
systemctl mask [unit type]	注销指定服务
systemctl unmask [unit type]	取消注销指定服务

init命令	systemctl命令	说明
init 0	systemctl poweroff	系统关机
init 6	systemctl reboot	重新启动

systemctl命令	说明
systemctl suspend	进入睡眠模式
systemctl hibernate	进入休眠模式
systemctl rescue	强制进入救援模式
systemctl emergency	强制进入紧急救援模式

init级别	systemctl target
0	shutdown.target
1	emergency.target
2	rescure.target
3	multi-user.target
4	无
5	graphical.target
6	无

systemctl命令	说明
systemctl get-default	获得当前的运行级别
systemctl set-default multi-user.target	设置默认的运行级别为mulit-user
systemctl isolate multi-user.target	在不重启的情况下,切换到运行级别mulit-user下
systemctl isolate graphical.target	在不重启的情况下,切换到图形界面下


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值