Skip to main content

debug1: read_passphrase: can't open /dev/tty: No such device or address

debug1: read_passphrase: can't open /dev/tty: No such device or address

The log says that your private key is encrypted and the client can't use it before you will enter a passphrase. AsAnd as you say in your comment "The key is automatically unlocked when I log in but apparently not for systemd":

The key is automatically unlocked when I log in but apparently not for systemd

To ensure this is done, you need to execute the script as if you logged in with your login name.

[Unit]
Description=sync Bilder to nas
[Service]
[Service]
User=YOURUSERNAMEUser=<YOUR USER NAME>
WorkingDirectory=/home/YOURUSERNAME<YOUR USER NAME>
ExecStart=bash -l -c "/home/tikey/scripts/nas_sync_photos_to_nas.sh"

from man bash:

-c string        If  the  -c  option  is  present, then commands are read from
                 string.  If there are arguments after the  string,  they  are
                 assigned to the positional parameters, starting with $0.

-l               Make bash act as if it had been invoked as a login shell (see
                 INVOCATION below).

from man systemd.exec:

User=, Group=    Set the UNIX user or group that the processes are executed as,
                 respectively. Takes a single user or group name, or a numeric 
                 ID as argument. etc...

debug1: read_passphrase: can't open /dev/tty: No such device or address

The log says that your private key is encrypted and the client can't use it before you will enter a passphrase. As you say in your comment "The key is automatically unlocked when I log in but apparently not for systemd"

To ensure this is done, you need to execute the script as if you logged in with your login name.

[Unit]
Description=sync Bilder to nas
[Service]

User=YOURUSERNAME
WorkingDirectory=/home/YOURUSERNAME
ExecStart=bash -l -c "/home/tikey/scripts/nas_sync_photos_to_nas.sh"

from man bash:

-c string        If  the  -c  option  is  present, then commands are read from
                 string.  If there are arguments after the  string,  they  are
                 assigned to the positional parameters, starting with $0.

-l               Make bash act as if it had been invoked as a login shell (see
                 INVOCATION below).

from man systemd.exec:

User=, Group=    Set the UNIX user or group that the processes are executed as,
                 respectively. Takes a single user or group name, or a numeric 
                 ID as argument. etc...

debug1: read_passphrase: can't open /dev/tty: No such device or address

The log says that your private key is encrypted and the client can't use it before you will enter a passphrase. And as you say in your comment:

The key is automatically unlocked when I log in but apparently not for systemd

To ensure this is done, you need to execute the script as if you logged in with your login name.

[Unit]
Description=sync Bilder to nas

[Service]
User=<YOUR USER NAME>
WorkingDirectory=/home/<YOUR USER NAME>
ExecStart=bash -l -c "/home/tikey/scripts/nas_sync_photos_to_nas.sh"

from man bash:

-c string        If  the  -c  option  is  present, then commands are read from
                 string.  If there are arguments after the  string,  they  are
                 assigned to the positional parameters, starting with $0.

-l               Make bash act as if it had been invoked as a login shell (see
                 INVOCATION below).

from man systemd.exec:

User=, Group=    Set the UNIX user or group that the processes are executed as,
                 respectively. Takes a single user or group name, or a numeric 
                 ID as argument. etc...
deleted 87 characters in body
Source Link

debug1: read_passphrase: can't open /dev/tty: No such device or address

The log says that your private key is encrypted and the client can't use it before you will enter a passphrase. As you say in your comment "The key is automatically unlocked when I log in but apparently not for systemd"

Because it's a user who has the key/keyringTo ensure this is done, you need to execute the script as if you logged in with your login name.

[Unit]
Description=sync Bilder to nas
[Service]

User=YOURUSERNAME
WorkingDirectory=/home/YOURUSERNAME
ExecStart=bash -l -c "/home/tikey/scripts/nas_sync_photos_to_nas.sh"

from man bash:

-c string        If  the  -c  option  is  present, then commands are read from
                 string.  If there are arguments after the  string,  they  are
                 assigned to the positional parameters, starting with $0.

-l               Make bash act as if it had been invoked as a login shell (see
                 INVOCATION below).

from man systemd.exec:

User=, Group=    Set the UNIX user or group that the processes are executed as,
                 respectively. Takes a single user or group name, or a numeric 
                 ID as argument. etc...

debug1: read_passphrase: can't open /dev/tty: No such device or address

The log says that your private key is encrypted and the client can't use it before you will enter a passphrase.

Because it's a user who has the key/keyring, you need to execute the script as if you logged in with your login name.

[Unit]
Description=sync Bilder to nas
[Service]

User=YOURUSERNAME
WorkingDirectory=/home/YOURUSERNAME
ExecStart=bash -l -c "/home/tikey/scripts/nas_sync_photos_to_nas.sh"

from man bash:

-c string        If  the  -c  option  is  present, then commands are read from
                 string.  If there are arguments after the  string,  they  are
                 assigned to the positional parameters, starting with $0.

-l               Make bash act as if it had been invoked as a login shell (see
                 INVOCATION below).

from man systemd.exec:

User=, Group=    Set the UNIX user or group that the processes are executed as,
                 respectively. Takes a single user or group name, or a numeric 
                 ID as argument. etc...

debug1: read_passphrase: can't open /dev/tty: No such device or address

The log says that your private key is encrypted and the client can't use it before you will enter a passphrase. As you say in your comment "The key is automatically unlocked when I log in but apparently not for systemd"

To ensure this is done, you need to execute the script as if you logged in with your login name.

[Unit]
Description=sync Bilder to nas
[Service]

User=YOURUSERNAME
WorkingDirectory=/home/YOURUSERNAME
ExecStart=bash -l -c "/home/tikey/scripts/nas_sync_photos_to_nas.sh"

from man bash:

-c string        If  the  -c  option  is  present, then commands are read from
                 string.  If there are arguments after the  string,  they  are
                 assigned to the positional parameters, starting with $0.

-l               Make bash act as if it had been invoked as a login shell (see
                 INVOCATION below).

from man systemd.exec:

User=, Group=    Set the UNIX user or group that the processes are executed as,
                 respectively. Takes a single user or group name, or a numeric 
                 ID as argument. etc...
deleted 87 characters in body
Source Link

debug1: read_passphrase: can't open /dev/tty: No such device or address

The log says that your private key is encrypted and the client can't use it before you will enter a passphrase. Either use unencrypted key or use again some dirty workaround using sshpass.

Because it's a different user who has the key/keyring, you need to execute the script as if you logged in with your login name.

[Unit]
Description=sync Bilder to nas
[Service]

User=YOURUSERNAME
WorkingDirectory=/home/YOURUSERNAME
ExecStart=bash -l -c "/home/tikey/scripts/nas_sync_photos_to_nas.sh"

from man bash:

-c string        If  the  -c  option  is  present, then commands are read from
                 string.  If there are arguments after the  string,  they  are
                 assigned to the positional parameters, starting with $0.

-l               Make bash act as if it had been invoked as a login shell (see
                 INVOCATION below).

from man systemd.exec:

User=, Group=    Set the UNIX user or group that the processes are executed as,
                 respectively. Takes a single user or group name, or a numeric 
                 ID as argument. etc...

debug1: read_passphrase: can't open /dev/tty: No such device or address

The log says that your private key is encrypted and the client can't use it before you will enter a passphrase. Either use unencrypted key or use again some dirty workaround using sshpass.

Because it's a different user who has the key/keyring, you need to execute the script as if you logged in with your login name.

[Unit]
Description=sync Bilder to nas
[Service]

User=YOURUSERNAME
WorkingDirectory=/home/YOURUSERNAME
ExecStart=bash -l -c "/home/tikey/scripts/nas_sync_photos_to_nas.sh"

from man bash:

-c string        If  the  -c  option  is  present, then commands are read from
                 string.  If there are arguments after the  string,  they  are
                 assigned to the positional parameters, starting with $0.

-l               Make bash act as if it had been invoked as a login shell (see
                 INVOCATION below).

from man systemd.exec:

User=, Group=    Set the UNIX user or group that the processes are executed as,
                 respectively. Takes a single user or group name, or a numeric 
                 ID as argument. etc...

debug1: read_passphrase: can't open /dev/tty: No such device or address

The log says that your private key is encrypted and the client can't use it before you will enter a passphrase.

Because it's a user who has the key/keyring, you need to execute the script as if you logged in with your login name.

[Unit]
Description=sync Bilder to nas
[Service]

User=YOURUSERNAME
WorkingDirectory=/home/YOURUSERNAME
ExecStart=bash -l -c "/home/tikey/scripts/nas_sync_photos_to_nas.sh"

from man bash:

-c string        If  the  -c  option  is  present, then commands are read from
                 string.  If there are arguments after the  string,  they  are
                 assigned to the positional parameters, starting with $0.

-l               Make bash act as if it had been invoked as a login shell (see
                 INVOCATION below).

from man systemd.exec:

User=, Group=    Set the UNIX user or group that the processes are executed as,
                 respectively. Takes a single user or group name, or a numeric 
                 ID as argument. etc...
Source Link
Loading