1

How can I restrict login so that only I can log into my linux machine, and only directly into the console (active user) I do not want anyone, including me, to be able to log in remotely. Are there changes I should make to /etc/security/access.conf for example? or PAM?

Newbie here.

0

1 Answer 1

1

You could disable ssh

systemctl disable ssh
systemctl stop ssh

Don't touch /etc/security/access.conf or PAM. Look by all means, but don't change anything at all unless you know exactly what you're doing and how you'll fix it if it prevents you logging in at all.

4
  • 2
    Right Chris, I am not touching those files! ty.
    – pac_2023
    Commented Nov 3, 2023 at 17:45
  • I've done that Chris and I get this in return: "Failed to disable unit: Unit file ssh.service does not exist." In the journal log I see this. What does this mean? Is this a clue?: Nov 03 13:32:11 pac_2023 gnome-keyring-daemon[1223]: SSH_AUTH_SOCK=/run/user/1000/keyring/ssh Nov 03 13:32:11 pac_2023 sh[1226]: dbus-update-activation-environment: setting SSH_AUTH_SOCK=/run/user/1000/keyring/ssh Nov 03 13:32:11 pac_2023 sh[1226]: dbus-update-activation-environment: setting SSH_AGENT_LAUNCHER=gnome-keyring
    – pac_2023
    Commented Nov 3, 2023 at 18:21
  • Sounds like you haven't got a remote login feature installed Commented Nov 3, 2023 at 18:28
  • Try the systemctl commands but with sshd as the name instead of ssh. Some distros use ssh.service, others sshd.service.
    – Sotto Voce
    Commented Nov 3, 2023 at 22:35

You must log in to answer this question.

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