0%

树莓派-使用sftp日志出现大量session-c**.scope解决方法

在使用SFTP的时候,发现syslog日志中出现很多 Started Session c** , session-c**.scope

Jan 31 22:45:05 raspberrypi systemd[1]: Started Session c31 of user pi.
Jan 31 22:45:09 raspberrypi systemd[1]: session-c31.scope: Succeeded.
Jan 31 22:45:18 raspberrypi systemd[1]: Started Session c32 of user pi.
Jan 31 22:45:18 raspberrypi systemd[1]: Started Session c33 of user pi.
Jan 31 22:45:19 raspberrypi systemd[1]: session-c32.scope: Succeeded.
Jan 31 22:45:19 raspberrypi systemd[1]: session-c33.scope: Succeeded.
Jan 31 22:45:20 raspberrypi systemd[1]: Started Session c34 of user pi.
Jan 31 22:45:20 raspberrypi systemd[1]: session-c34.scope: Succeeded.
Jan 31 22:45:21 raspberrypi systemd[1]: Started Session c35 of user pi.
Jan 31 22:45:21 raspberrypi systemd[1]: session-c35.scope: Succeeded.

可以通过提高systemd的日志等级来解决这个问题

编辑 /etc/systemd/system.conf 文件

  • 把 #LogLevel=info 改为 LogLevel=notice

重新加载sytemd配置

systemctl daemon-reload