วันเสาร์ที่ 16 พฤศจิกายน พ.ศ. 2562

[Linux Container] - เปิดใช้ SSH ใน Linux Container

bash/shell
1
2
3
4
5
6
7
8
9
# Install OpenSSH Server
apt install openssh-server
 
# adduser <username>
adduser sarankon
 
# usermod -aG <groupname> <username>
usermod -aG sudo sarnakon
</username></groupname></username>

แก้ไข Config File ที่ "/etc/ssh/ssh_config" โดยเปิด PasswordAuthentication yes
/etc/ssh/ssh_config
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Host *
#   ForwardAgent no
#   ForwardX11 no
#   ForwardX11Trusted yes
    PasswordAuthentication yes
#   HostbasedAuthentication no
#   GSSAPIAuthentication no
#   GSSAPIDelegateCredentials no
#   GSSAPIKeyExchange no
#   GSSAPITrustDNS no
#   BatchMode no
#   CheckHostIP yes
#   AddressFamily any
#   ConnectTimeout 0

แก้ไข Config File ที่ "/etc/ssh/sshd_config" โดยเปิด PasswordAuthentication yes
/etc/ssh/sshd_config
1
2
# To disable tunneled clear text passwords, change to no here!
PasswordAuthentication yes
bash/shell
1
systemctl restart ssh

ไม่มีความคิดเห็น:

แสดงความคิดเห็น