B
B
Benjamin2018-04-26 22:43:08
linux
Benjamin, 2018-04-26 22:43:08

How is security maintained when executing commands via ssh?

Good day colleagues!
There is interest in the following question.
1) We generate the ssh key
2) We throw it on the target machine (the server in my case)
3) We connect to the server
ssh [email protected] - тут все хорошо, вопросов нет
4) We execute the command
[email protected] # ls -la
When connecting to the target machine (point 3), the key verification logic is clear to me, we got access to the server.
When we try to execute a command (in principle, it doesn't matter which one, let it be ls -la ) (point 4)
are any additional checks made on the server in terms of security?
There is an absurd assumption that every time the command is executed, the keys are checked, I think this is most likely not the case.
Can someone tell me what is the algorithm for executing a command on a remote machine? (Provided that we have already connected to the server).
It will be enough to have a source where it can be read
Thank you all.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jcmvbkbc, 2018-04-26
@Itspacedev

When we try to execute a command (in principle, no matter what, let it be ls -la) (point 4),
are any additional checks made on the server in terms of security?

No. A user logged in via ssh is no different from a regular local user.
Just look at the output of the pstree command:
├─sshd(700)─┬─sshd(8208)───sshd(8214,jcmvbkbc)───bash(8215)───ssh(8231)
│           └─sshd(8232)───sshd(8238,jcmvbkbc)───bash(8239)───pstree(8244)

to understand that after connecting via ssh, sshd (ssh daemon, process 8238) starts a login-shell (process 8239) which shows the input prompt ($). When the pstree command (process 8244) is typed into it, the shell simply runs that command.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question