LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-14-2020, 02:30 AM   #1
yangyiin
Member
 
Registered: Nov 2018
Posts: 44

Rep: Reputation: Disabled
ssh


hi,
i see that when i login with ssh:
ssh y@remote
In remote:

Code:
 ps -ef|grep y
root      20448   1292  0 09:19 ?        00:00:00 sshd: y [priv]
y   20483  20448  0 09:19 ?        00:00:00 sshd: y@pts/12
y   20484  20483  0 09:19 pts/12   00:00:00 -bash
y   21708  20484  0 09:26 pts/12   00:00:00 ps -ef
why this ssh connection start as root user and then as y user?
 
Old 11-14-2020, 02:37 AM   #2
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,331
Blog Entries: 3

Rep: Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726
The idea is to separate the privileges as much as possible and give each one the least amount of privilege necessary to accomplish its task.

The root-level access is necessary to bind to a low port, and to launch child processes as other accounts. Since port 22 is needed for incoming connections the daemon is launched as root. Then an unprivileged account, sshd, is used to deal with the initial parts of an incoming connection, and that too needs root. Once you are authenticated, a process is launched for your account, again by root. Thereafter you are only dealing with your own processes.

tldr; privilege separation.
 
2 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to log ssh activity in /var/log/ssh/ssh*.log MrUmunhum Linux - Server 3 11-02-2011 02:25 AM
ssh-agent, ssh-add and ssh-keygen AND CVS raylpc Linux - General 2 11-19-2008 02:50 AM
setting up an ssh soxy or local ssh tunnel from within an ssh soxy Mangenius Linux - Networking 0 03-05-2007 03:15 PM
Passwordless SSH with SSH commercial server and open ssh cereal83 Linux - General 7 04-18-2006 12:34 PM
Ssh (again) and ssh key? Half_Elf Linux - General 26 08-07-2002 02:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration