Ubuntu 16.04 及以后版本的串口登陆配置

添加一个新的文件 /lib/systemd/system/ttyUSB0.service (文件名字自己取,这里用usb 串口举例)

root@my_desktop:~# cat /lib/systemd/system/ttyUSB0.service 
[Unit]
Description=USB serial console service

[Service]
ExecStart=/sbin/getty -L 115200 ttyUSB0 vt102
Restart=always

[Install]
WantedBy=multi-user.target

ttyUSB0 是驱动文件的名字,根据实际环境替换
然后执行如下命令启动service

root@my_desktop:~# systemctl daemon-reload
root@my_desktop:~#  systemctl enable ttyUSB0
Created symlink from /etc/systemd/system/multi-user.target.wants/ttyUSB0.service to /lib/systemd/system/ttyUSB0.service.
root@my_desktop:~# systemctl start ttyUSB0

你可能感兴趣的:(Ubuntu 16.04 及以后版本的串口登陆配置)