Otu esi agbanyụọ ma ọ bụ mee ka SSH Root Login ma kpachie ohere SSH


Onye ọ bụla maara na usoro Linux na-abịa na ohere onye ọrụ mgbọrọgwụ na site na ndabara, a na-enye ohere mgbọrọgwụ maka ụwa dị n'èzí.

Maka ebumnuche nchekwa, ọ bụghị ezi echiche ịnweta ohere mgbọrọgwụ ssh maka ndị ọrụ na-enweghị ikike. N'ihi na onye ọ bụla hacker nwere ike ịnwa imebi ike paswọọdụ gị wee nweta ohere na sistemụ gị.

Ya mere, ọ ka mma ịnweta akaụntụ ọzọ ị na-ejikarị eme ihe wee gbanwee na onye ọrụ mgbọrọgwụ site na iji iwu 'su -' mgbe ọ dị mkpa. Tupu anyị amalite, jide n'aka na ị nwere akaụntụ njirimara mgbe niile na nke ahụ, ị sudo ma ọ bụ sudo iji nweta ohere mgbọrọgwụ.

[Ị nwekwara ike ịmasị: Otu esi echekwa ma sie ike OpenSSH Server]

Na Linux, ọ dị mfe ịmepụta akaụntụ dị iche, banye dị ka onye ọrụ mgbọrọgwụ wee mee naanị iwu adduser ka ịmepụta onye ọrụ dị iche. Ozugbo emepụtara onye ọrụ, naanị soro usoro ndị a iji gbanyụọ nbanye mgbọrọgwụ site na SSH.

Anyị na-eji faịlụ nhazi nhazi sshd iji gbanyụọ nbanye mgbọrọgwụ na nke a nwere ike ibelata ma gbochie onye na-agba ọsọ ịnweta mgbọrọgwụ na igbe Linux gị. Anyị na-ahụkwa ka esi eme ka mgbọrọgwụ nweta ohere ọzọ yana otu esi egbochi ohere ssh dabere na ndepụta ndị ọrụ.

Gbanyụọ nbanye SSH mgbọrọgwụ

Iji gbanyụọ nbanye mgbọrọgwụ, mepee faịlụ nhazi ssh isi /etc/ssh/sshd_config na nhọrọ nchịkọta nhọrọ gị.

# vi /etc/ssh/sshd_config

Chọọ ahịrị ndị a na faịlụ ahụ.

#PermitRootLogin no

Wepu '#' site na mmalite nke ahịrị. Mee ka ahịrị ahụ yie nke a.

PermitRootLogin no

Ọzọ, anyị kwesịrị ịmalitegharị ọrụ daemon SSH.

# systemctl restart sshd
OR
# /etc/init.d/sshd restart

Ugbu a gbalịa ịbanye na onye ọrụ mgbọrọgwụ, ị ga-enweta njehie ajụrụ ikike.

$ ssh [email 
[email 's password: 
Permission denied, please try again.

Ya mere, site ugbu a gaa n'ihu nbanye dị ka onye ọrụ nkịtị wee jiri iwu 'su' gbanwee gaa na onye ọrụ mgbọrọgwụ.

$ ssh [email 
[email 's password:
Last login: Mon Dec 27 15:04:58 2021 from 192.168.0.161

$ su -
Password:
Last login: Mon Dec 27 15:05:07 IST 2021 on pts/1

Kwado Nbanye SSH Root

Iji mee ka mgbọrọgwụ mgbọrọgwụ ssh mepee, mepee faịlụ /etc/ssh/sshd_config.

# vi /etc/ssh/sshd_config

Chọọ ahịrị ndị a wee wepụ '#' na mbido wee chekwaa faịlụ ahụ.

PermitRootLogin yes

Malitegharịa ọrụ sshd.

# systemctl restart sshd
OR
# /etc/init.d/sshd restart

Ugbu a gbalịa ịbanye na onye ọrụ mgbọrọgwụ.

$ ssh [email 
[email 's password:
Last login: Mon Dec 27 15:14:54 2021 from 192.168.0.161

Machie nbanye onye ọrụ SSH

Ọ bụrụ na ị nwere ọnụ ọgụgụ buru ibu nke akaụntụ onye ọrụ na sistemụ, mgbe ahụ ọ bụ ihe ezi uche dị na ya na anyị na-amachi ohere SSH dịpụrụ adịpụ maka ndị ọrụ ahụ chọrọ ya n'ezie. Mepee faịlụ /etc/ssh/sshd_config.

# vi /etc/ssh/sshd_config

Tinye ahịrị AllowUsers dị na ala nke faịlụ ahụ yana oghere nke ndepụta aha njirimara kewapụrụ. Dịka ọmụmaatụ, onye ọrụ tecmint na sheena ha abụọ nwere ohere ssh remote.

AllowUsers tecmint sheena

Ugbu a malitegharịa ọrụ ssh.