What is not working as you expected it to, what did you expect?

|
min 2022-08-18 16:48:22
smol_mazunki 2022-08-18 16:47:37
sudo systemctl sshd start gg wp you’re done

No, it don’t works!

smol_mazunki 2022-08-18 16:48:26
min 2022-08-18 16:48:22
No, it don’t works!

swap the order

smol_mazunki 2022-08-18 16:48:33
of start and sshd
min 2022-08-18 16:48:44
It’s the same as simple systemctl start sshd
ufoludek 2022-08-18 16:48:47
min 2022-08-18 16:48:22
No, it don’t works!

It’s not our fault you can’t read and use google

min 2022-08-18 16:49:02
smol_mazunki 2022-08-18 16:48:26
swap the order

Already done, it’s dont work

smol_mazunki 2022-08-18 16:49:08
min 2022-08-18 16:48:22
No, it don’t works!

have you tried turning it on and back off again

ufoludek 2022-08-18 16:49:13
Instead of shouting it doesn’t work you could just type “how to start ssh server [distro name here]” on google
min 2022-08-18 16:49:21
smol_mazunki 2022-08-18 16:49:08
have you tried turning it on and back off again

Yes, and systemctl restart

smol_mazunki 2022-08-18 16:49:31
what exactly is not working, what have you tried, what feedback is your system giving you
smol_mazunki 2022-08-18 16:49:45
what is not working as you expected it to, what did you expect?
min 2022-08-18 16:50:30
min 2022-08-18 16:11:39
~ $ systemctl stop sshd
~ $ sudo /sbin/sshd
~ $ ssh git@127.0.0.1
Last login: Thu Aug 18 16:08:22 2022 from 127.0.0.1
[git@fedora ~]$

I want this by systemctl start sshd

min 2022-08-18 16:50:39
min 2022-08-18 16:09:55
~ $ systemctl start sshd
~ $ systemctl status sshd
● sshd.service – OpenSSH server daemon
Loaded: loaded (/usr/lib/systemd/system/sshd.service; disabled; vendor preset: disabled)
Active: active (running) since Thu 2022-08-18 16:09:08 MSK; 9s ago
Docs: man:sshd(8)
man:sshd_config(5)
Main PID: 12703 (sshd)
Tasks: 1 (limit: 38392)
Memory: 1.3M
CPU: 10ms
CGroup: /system.slice/sshd.service
└─ 12703 “sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups”

авг 18 16:09:08 fedora systemd[1]: Starting sshd.service – OpenSSH server daemon…
авг 18 16:09:08 fedora sshd[12703]: Server listening on 0.0.0.0 port 22.
авг 18 16:09:08 fedora sshd[12703]: Server listening on :: port 22.
авг 18 16:09:08 fedora systemd[1]: Started sshd.service – OpenSSH server daemon.
~ $ ssh git@127.0.0.1
git@127.0.0.1’s password:

~ $ systemctl status sshd
● sshd.service – OpenSSH server daemon
Loaded: loaded (/usr/lib/systemd/system/sshd.service; disabled; vendor preset: disabled)
Active: active (running) since Thu 2022-08-18 16:09:08 MSK; 16s ago
Docs: man:sshd(8)
man:sshd_config(5)
Main PID: 12703 (sshd)
Tasks: 1 (limit: 38392)
Memory: 1.3M
CPU: 33ms
CGroup: /system.slice/sshd.service
└─ 12703 “sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups”

авг 18 16:09:08 fedora systemd[1]: Starting sshd.service – OpenSSH server daemon…
авг 18 16:09:08 fedora sshd[12703]: Server listening on 0.0.0.0 port 22.
авг 18 16:09:08 fedora sshd[12703]: Server listening on :: port 22.
авг 18 16:09:08 fedora systemd[1]: Started sshd.service – OpenSSH server daemon.
авг 18 16:09:23 fedora sshd[12730]: Connection closed by authenticating user git 127.0.0.1 port 36502 [preauth]

But got this

smol_mazunki 2022-08-18 16:51:22
min 2022-08-18 16:09:55
~ $ systemctl start sshd
~ $ systemctl status sshd
● sshd.service – OpenSSH server daemon
Loaded: loaded (/usr/lib/systemd/system/sshd.service; disabled; vendor preset: disabled)
Active: active (running) since Thu 2022-08-18 16:09:08 MSK; 9s ago
Docs: man:sshd(8)
man:sshd_config(5)
Main PID: 12703 (sshd)
Tasks: 1 (limit: 38392)
Memory: 1.3M
CPU: 10ms
CGroup: /system.slice/sshd.service
└─ 12703 “sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups”

авг 18 16:09:08 fedora systemd[1]: Starting sshd.service – OpenSSH server daemon…
авг 18 16:09:08 fedora sshd[12703]: Server listening on 0.0.0.0 port 22.
авг 18 16:09:08 fedora sshd[12703]: Server listening on :: port 22.
авг 18 16:09:08 fedora systemd[1]: Started sshd.service – OpenSSH server daemon.
~ $ ssh git@127.0.0.1
git@127.0.0.1’s password:

~ $ systemctl status sshd
● sshd.service – OpenSSH server daemon
Loaded: loaded (/usr/lib/systemd/system/sshd.service; disabled; vendor preset: disabled)
Active: active (running) since Thu 2022-08-18 16:09:08 MSK; 16s ago
Docs: man:sshd(8)
man:sshd_config(5)
Main PID: 12703 (sshd)
Tasks: 1 (limit: 38392)
Memory: 1.3M
CPU: 33ms
CGroup: /system.slice/sshd.service
└─ 12703 “sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups”

авг 18 16:09:08 fedora systemd[1]: Starting sshd.service – OpenSSH server daemon…
авг 18 16:09:08 fedora sshd[12703]: Server listening on 0.0.0.0 port 22.
авг 18 16:09:08 fedora sshd[12703]: Server listening on :: port 22.
авг 18 16:09:08 fedora systemd[1]: Started sshd.service – OpenSSH server daemon.
авг 18 16:09:23 fedora sshd[12730]: Connection closed by authenticating user git 127.0.0.1 port 36502 [preauth]

to me this looks like it’s working

min 2022-08-18 16:51:29
~ $ ssh git@127.0.0.1
Last login: Thu Aug 18 16:08:22 2022 from 127.0.0.1
[git@fedora ~]$
vs
~ $ ssh git@127.0.0.1
git@127.0.0.1’s password:
smol_mazunki 2022-08-18 16:51:56
min 2022-08-18 16:51:29
~ $ ssh git@127.0.0.1
Last login: Thu Aug 18 16:08:22 2022 from 127.0.0.1
[git@fedora ~]$
vs
~ $ ssh git@127.0.0.1
git@127.0.0.1’s password:

oh, you’re not getting authenticated when logging in

smol_mazunki 2022-08-18 16:52:17
that’s the sshd server responding to your ssh request with “yo, pls can you confirm you’re who you say you are”
smol_mazunki 2022-08-18 16:52:40
throw in a -vv there to see what’s going on
smol_mazunki 2022-08-18 16:52:49
it will tell you what keys it’s trying, and which ones it’s refusing
smol_mazunki 2022-08-18 16:53:36
have you told git to grant access to $USER’s public key?
min 2022-08-18 16:53:44
smol_mazunki 2022-08-18 16:52:40
throw in a -vv there to see what’s going on

debug1: Offering public key: /home/user/.ssh/id_rsa RSA SHA256:LyZwuuY4bTecXd4+LPpmc+CneBTr2lkyUjq5A8QBEmw agent
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 51

smol_mazunki 2022-08-18 16:54:18
min 2022-08-18 16:53:44
debug1: Offering public key: /home/user/.ssh/id_rsa RSA SHA256:LyZwuuY4bTecXd4+LPpmc+CneBTr2lkyUjq5A8QBEmw agent
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 51

that’s all?

smol_mazunki 2022-08-18 16:55:20
you can slap on a third -v for even more info
min 2022-08-18 16:55:49
smol_mazunki 2022-08-18 16:54:18
that’s all?

It’s trouble. If sshd starting from command line:
debug1: Server accepts key: /home/user/.ssh/id_rsa RSA SHA256:LyZwuuY4bTecXd4+LPpmc+CneBTr2lkyUjq5A8QBEmw agent
debug3: send packet: type 50
debug3: receive packet: type 52

min 2022-08-18 16:56:15
It’s not trouble of a client
min 2022-08-18 16:56:31
Server started from systemctl not works
min 2022-08-18 16:56:47
It send type 51
smol_mazunki 2022-08-18 16:56:56
this is a sane output http://ix.io/47X8
smol_mazunki 2022-08-18 16:58:17
min 2022-08-18 16:56:31
Server started from systemctl not works

what are the journalctl logs saying about it?

smol_mazunki 2022-08-18 16:58:53
is sshd receiving the key?
smol_mazunki 2022-08-18 17:01:37
linux_group-1394465.jpg

smol_mazunki 2022-08-18 17:01:37
linux_group-1394464.jpg

smol_mazunki 2022-08-18 17:01:37
linux_group-1394463.jpg
we can clearly see the sshd server accepting the connection, but is waiting for authentication after i accept the request
smol_mazunki 2022-08-18 17:01:54
after finally accepting the authentication, it opens the tty
smol_mazunki 2022-08-18 17:03:48
linux_group-1394467.jpg
we can also see this happening in the logs
|