学校服务器配置ssh和内网穿透
CentOS
设置root账户
sudo passwd root
开启ssh
1、安装ssh服务
yum install -y openssh-server
2、修改sshd服务配置文件
vim /etc/ssh/sshd_config
Port 22
ListenAddress 0.0.0.0
ListenAddress ::
PermitRootLogin yes
PasswordAuthentication yes
#LoginGraceTime 2m
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10
ChallengeResponseAuthentication no
GSSAPIAuthentication yes
GSSAPICleanupCredentials no
UsePAM yes
X11Forwarding yes
AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
AcceptEnv LC_IDENTIFICATION LC_ALL LANGUAGE
AcceptEnv XMODIFIERS
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key
AuthorizedKeysFile .ssh/authorized_keys
Subsystem sftp /usr/libexec/openssh/sftp-server
3、开启ssh服务
systemctl start sshd
安装JDK
yum install -y java-1.8.0-openjdk.x86_64
配置内网穿透
su u2600469
cd /home/u2600469
# sudo yum install unzip
# wget https://skyemperor.top/file/frpc_isdu.zip
# unzip frp.zip
cd frp/frp51
# chmod +x frpc start.sh
./start.sh start
tail -f -n 500 frpc.ini
运行sdujar
cd sdujar
./start start
Ubuntu
更新阿里源
vim /etc/apt/sources.list
#将/etc/apt/sources.list文件里的内容替换为下方
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
apt update #更新
配置ssh
#安装openssh-client
apt install -y openssh-server openssh-client
# 修改该文件把PermitRootLogin Prohibit-password注释掉
vim /etc/ssh/sshd_config
新添加:PermitRootLogin yes
# 重启ssh服务
/etc/init.d/ssh restart
配置内网穿透
su u2600469
cd /home/u2600469
# sudo yum install unzip
# wget https://skyemperor.top/file/frpc_isdu.zip
# unzip frp.zip
cd frp/frp_sky
# chmod +x frpc start.sh
./start.sh start
tail -f -n 500 frpc.ini
Comments | 0 条评论