I have written a service as it was given in this question but when I run the service I get only error in status.
service:
GNU nano 6.2 /etc/systemd/system/sshuttle.service
[Unit]
Description=sshuttle tunnel
[Service]
Restart=always
User=user
Group=user
ExecStart=/usr/bin/sshuttle -vr my-ip 0/0 -x my-ip/32 --ssh-cmd 'ssh -i ~/server.pem'
[Install]
WantedBy=multi-user.target
error I get in status:
× sshuttle.service - sshuttle tunnel
Loaded: loaded (/etc/systemd/system/sshuttle.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2023-04-02 11:12:09 +0330; 1s ago
Process: 2142 ExecStart=/usr/bin/sshuttle -vr my-ip 0/0 -x my-ip/32 --ssh-cmd ssh -i ~/server.pem (code=exited, status=217/USER)
Main PID: 2142 (code=exited, status=217/USER)
CPU: 1ms
Apr 02 11:12:09 mj-virtual-machine systemd[1]: sshuttle.service: Scheduled restart job, restart counter is at 5.
Apr 02 11:12:09 mj-virtual-machine systemd[1]: Stopped sshuttle tunnel.
Apr 02 11:12:09 mj-virtual-machine systemd[1]: sshuttle.service: Start request repeated too quickly.
Apr 02 11:12:09 mj-virtual-machine systemd[1]: sshuttle.service: Failed with result 'exit-code'.
Apr 02 11:12:09 mj-virtual-machine systemd[1]: Failed to start sshuttle tunnel.
updated config:
[Unit]
Description=sshuttle tunnel
[Service]
Restart=always
ExecStart=/usr/bin/sshuttle -vr ssh-user@ssh-ip 0/0 -x ssh-ip/32 --ssh-cmd 'ssh -i /home/mj/server.pem'
[Install]
WantedBy=multi-user.target