Skip to content

Commit aa58184

Browse files
pmh-onlyericlee05
andcommitted
feat: add many things
Co-authored-by: V!NT0 <[email protected]>
1 parent 26bbcab commit aa58184

File tree

4 files changed

+248
-3
lines changed

4 files changed

+248
-3
lines changed

.bashrc

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# ~/.bashrc: executed by bash(1) for non-login shells.
2+
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
3+
# for examples
4+
5+
# If not running interactively, don't do anything
6+
[ -z "$PS1" ] && return
7+
8+
# don't put duplicate lines in the history. See bash(1) for more options
9+
# ... or force ignoredups and ignorespace
10+
HISTCONTROL=ignoredups:ignorespace
11+
12+
# append to the history file, don't overwrite it
13+
shopt -s histappend
14+
15+
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
16+
HISTSIZE=1000
17+
HISTFILESIZE=2000
18+
19+
# check the window size after each command and, if necessary,
20+
# update the values of LINES and COLUMNS.
21+
shopt -s checkwinsize
22+
23+
# make less more friendly for non-text input files, see lesspipe(1)
24+
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
25+
26+
# set variable identifying the chroot you work in (used in the prompt below)
27+
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
28+
debian_chroot=$(cat /etc/debian_chroot)
29+
fi
30+
31+
# set a fancy prompt (non-color, unless we know we "want" color)
32+
case "$TERM" in
33+
xterm-color) color_prompt=yes;;
34+
esac
35+
36+
# uncomment for a colored prompt, if the terminal has the capability; turned
37+
# off by default to not distract the user: the focus in a terminal window
38+
# should be on the output of commands, not on the prompt
39+
#force_color_prompt=yes
40+
41+
if [ -n "$force_color_prompt" ]; then
42+
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
43+
# We have color support; assume it's compliant with Ecma-48
44+
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
45+
# a case would tend to support setf rather than setaf.)
46+
color_prompt=yes
47+
else
48+
color_prompt=
49+
fi
50+
fi
51+
52+
if [ "$color_prompt" = yes ]; then
53+
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
54+
else
55+
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
56+
fi
57+
unset color_prompt force_color_prompt
58+
59+
# If this is an xterm set the title to user@host:dir
60+
case "$TERM" in
61+
xterm*|rxvt*)
62+
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
63+
;;
64+
*)
65+
;;
66+
esac
67+
68+
# enable color support of ls and also add handy aliases
69+
if [ -x /usr/bin/dircolors ]; then
70+
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
71+
alias ls='ls --color=auto'
72+
#alias dir='dir --color=auto'
73+
#alias vdir='vdir --color=auto'
74+
75+
alias grep='grep --color=auto'
76+
alias fgrep='fgrep --color=auto'
77+
alias egrep='egrep --color=auto'
78+
fi
79+
80+
# some more ls aliases
81+
alias ll='ls -alF'
82+
alias la='ls -A'
83+
alias l='ls -CF'
84+
85+
# Alias definitions.
86+
# You may want to put all your additions into a separate file like
87+
# ~/.bash_aliases, instead of adding them here directly.
88+
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
89+
90+
if [ -f ~/.bash_aliases ]; then
91+
. ~/.bash_aliases
92+
fi
93+
94+
# enable programmable completion features (you don't need to enable
95+
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
96+
# sources /etc/bash.bashrc).
97+
#if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
98+
# . /etc/bash_completion
99+
#fi
100+
101+
if [ ! -f ~/.pluxcon.lock ]; then
102+
echo "[en] please change default root password (blank to skip)"
103+
echo "[ko] 루트 비밀번호를 설정해 주세요 (미입력시 스킵)"
104+
105+
read -p "new password of root: " newpasswd
106+
echo "root:$newpasswd" | chpasswd &> /dev/null && touch ~/.pluxcon.lock
107+
fi

Dockerfile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
FROM ubuntu:bionic
22

3+
# Install openssh
34
RUN apt-get update
45
RUN apt-get install -y openssh-server
6+
57
RUN mkdir /var/run/sshd
68
RUN echo "root:toor" | chpasswd
7-
RUN sed -ri "s/^#?PermitRootLogin\s+.*/PermitRootLogin yes/" /etc/ssh/sshd_config
8-
RUN sed -ri 's/UsePAM yes/#UsePAM yes/g' /etc/ssh/sshd_config
99

10-
EXPOSE 22
10+
# Copy configurations
11+
COPY sshd_config /etc/ssh/
12+
COPY motd /etc/
13+
COPY .bashrc /root/
14+
15+
# Run ssh daemon
1116
CMD "/usr/sbin/sshd" -D

motd

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
________ ___ ___ ___ ___ ___ ________ ________ ________
2+
|\ __ \|\ \ |\ \|\ \ |\ \ / /| |\ ____\|\ __ \|\ ___ \
3+
\ \ \|\ \ \ \ \ \ \\\ \ \ \ \/ / | | \ \___|\ \ \|\ \ \ \\ \ \
4+
\ \ ____\ \ \ \ \ \\\ \ \ \ / / \ \ \ \ \ \\\ \ \ \\ \ \
5+
\ \ \___|\ \ \____\ \ \\\ \ / \/ \ \ \____\ \ \\\ \ \ \\ \ \
6+
\ \__\ \ \_______\ \_______\/ /\ \ \ \_______\ \_______\ \__\\ \__\
7+
\|__| \|_______|\|_______/__/ /\ __\ \|_______|\|_______|\|__| \|__|
8+
|__|/ \|__|
9+
10+
Virtual instance by Pluxcon Network with :heart:.
11+
Support: https://discord.gg/nwaCvhK23p

sshd_config

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
# $OpenBSD: sshd_config,v 1.101 2017/03/14 07:19:07 djm Exp $
2+
3+
# This is the sshd server system-wide configuration file. See
4+
# sshd_config(5) for more information.
5+
6+
# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin
7+
8+
# The strategy used for options in the default sshd_config shipped with
9+
# OpenSSH is to specify options with their default value where
10+
# possible, but leave them commented. Uncommented options override the
11+
# default value.
12+
13+
#Port 22
14+
#AddressFamily any
15+
#ListenAddress 0.0.0.0
16+
#ListenAddress ::
17+
18+
#HostKey /etc/ssh/ssh_host_rsa_key
19+
#HostKey /etc/ssh/ssh_host_ecdsa_key
20+
#HostKey /etc/ssh/ssh_host_ed25519_key
21+
22+
# Ciphers and keying
23+
#RekeyLimit default none
24+
25+
# Logging
26+
#SyslogFacility AUTH
27+
#LogLevel INFO
28+
29+
# Authentication:
30+
31+
#LoginGraceTime 2m
32+
PermitRootLogin yes
33+
#StrictModes yes
34+
#MaxAuthTries 6
35+
#MaxSessions 10
36+
37+
#PubkeyAuthentication yes
38+
39+
# Expect .ssh/authorized_keys2 to be disregarded by default in future.
40+
#AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys2
41+
42+
#AuthorizedPrincipalsFile none
43+
44+
#AuthorizedKeysCommand none
45+
#AuthorizedKeysCommandUser nobody
46+
47+
# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
48+
#HostbasedAuthentication no
49+
# Change to yes if you don't trust ~/.ssh/known_hosts for
50+
# HostbasedAuthentication
51+
#IgnoreUserKnownHosts no
52+
# Don't read the user's ~/.rhosts and ~/.shosts files
53+
#IgnoreRhosts yes
54+
55+
# To disable tunneled clear text passwords, change to no here!
56+
#PasswordAuthentication yes
57+
#PermitEmptyPasswords no
58+
59+
# Change to yes to enable challenge-response passwords (beware issues with
60+
# some PAM modules and threads)
61+
ChallengeResponseAuthentication no
62+
63+
# Kerberos options
64+
#KerberosAuthentication no
65+
#KerberosOrLocalPasswd yes
66+
#KerberosTicketCleanup yes
67+
#KerberosGetAFSToken no
68+
69+
# GSSAPI options
70+
#GSSAPIAuthentication no
71+
#GSSAPICleanupCredentials yes
72+
#GSSAPIStrictAcceptorCheck yes
73+
#GSSAPIKeyExchange no
74+
75+
# Set this to 'yes' to enable PAM authentication, account processing,
76+
# and session processing. If this is enabled, PAM authentication will
77+
# be allowed through the ChallengeResponseAuthentication and
78+
# PasswordAuthentication. Depending on your PAM configuration,
79+
# PAM authentication via ChallengeResponseAuthentication may bypass
80+
# the setting of "PermitRootLogin without-password".
81+
# If you just want the PAM account and session checks to run without
82+
# PAM authentication, then enable this but set PasswordAuthentication
83+
# and ChallengeResponseAuthentication to 'no'.
84+
#UsePAM yes
85+
86+
#AllowAgentForwarding yes
87+
#AllowTcpForwarding yes
88+
#GatewayPorts no
89+
X11Forwarding yes
90+
#X11DisplayOffset 10
91+
#X11UseLocalhost yes
92+
#PermitTTY yes
93+
PrintMotd yes
94+
PrintLastLog no
95+
#TCPKeepAlive yes
96+
#UseLogin no
97+
#PermitUserEnvironment no
98+
#Compression delayed
99+
#ClientAliveInterval 0
100+
#ClientAliveCountMax 3
101+
#UseDNS no
102+
#PidFile /var/run/sshd.pid
103+
#MaxStartups 10:30:100
104+
#PermitTunnel no
105+
#ChrootDirectory none
106+
#VersionAddendum none
107+
108+
# no default banner path
109+
#Banner none
110+
111+
# Allow client to pass locale environment variables
112+
AcceptEnv LANG LC_*
113+
114+
# override default of no subsystems
115+
Subsystem sftp /usr/lib/openssh/sftp-server
116+
117+
# Example of overriding settings on a per-user basis
118+
#Match User anoncvs
119+
# X11Forwarding no
120+
# AllowTcpForwarding no
121+
# PermitTTY no
122+
# ForceCommand cvs server

0 commit comments

Comments
 (0)