0

I am trying to update a script inside /etc/X11/Xstartup.d/00-myconf. It contains a command that works well when tested manually, but not in the script. This command uses a pair of RSA keys to ssh into a remote server.

ssh -i /var/subfolder/.ssh/id_rsa -o StrictHostKeyChecking=no specialuser@server "command"

Works well from the console, already logged as a student, but when I try to log via X11 I get a popup asking for specialuser password, which in turn triggers ksshaskpass to require a new wallet (we don't use them).

I can cancel the request and the session is finally opened, but it happens everytime a student tries to logon or logoff.

I hope you will give me some hints!

2
  • Is it asking for the password, or for the passphrase for the key? Do you have an AddKeysToAgent setting either in the client's global /etc/ssh/ssh_config or the students' ~/.ssh/config? You can check by running ssh -G specialuser@server as a student. Commented Apr 22 at 17:24
  • Use a single -v option on your ssh command to get information on what's happening, -vv to get more detail, -vvv to be buried in detail.
    – waltinator
    Commented Apr 22 at 19:54

1 Answer 1

0

I edited my question to provide more details and here is the answer.

For some (still unknown) reasons, lauching the command manually or inside the X11 logon script must be handled differently, especially reading the RSA private key.

When I launch the command manually, I am already logged as a student, the private key MUST be readable by anyone or the command won't work.

When I try the logon script, I get the following message in ssh log :

Permissions 0755 for '/var/exams/.ssh/id_rsa' are too open. It is required that your private key files are NOT accessible by others. This private key will be ignored.

So the solution was simply to chmod 700 the RSA key, and ignore the fact that the command won't work anymore manually.

Thanks to those who helped!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .