I am executing sshd in a bash script using
$ /usr/sbin/sshd
How do I get the process ID of this sshd that I executed?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
sshdwill typically write a PID file; by default this is at/var/run/sshd.pid. You can use this to find the process ID of the listeningsshdprocess. You should be aware thatsshdmay fork several subprocesses as it works, so what you want really depends on what you intend to do with it.