Setup SSH to disable direct root login.

Posted In SSH/Telnet - By Tum. On Tuesday, September 11th, 2007 With 0 Comments

การป้องกันไม่ให้ ssh เข้าเครื่องโดย Login เป็น root สามารถแก้ไขที่ไฟล์

#vi /etc/ssh/sshd_config

ตรงส่วนของ PermitRootLogin ให้เป็น no ดังข้างล่าง

PermitRootLogin no

จากนั้นให้ restart ssh โดยพิมพ์
#service sshd restart
Stopping sshd: [ OK ]
Starting sshd: [ OK ]

เมื่อทำการแก้ไขเรียบร้อยแล้วจะไม่สามารถ Login โดยใช้ root ได้ ดังนั้นจึงต้อง Login เป็น user อื่นก่อนแล้วค่อยใช้คำสั่ง su เปลี่ยนเป็น root โดยพิมพ์

#su – root

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

*