ifconfig
eth0,eth1,eth2……代表网卡一,网卡二,网卡三…… lo代表127.0.0.1,即localhost。
http://man7.org/linux/man-pages/man8/ifconfig.8.html
ssh :
查看ssh的安装包 :rpm -qa | grep ssh
查看ssh是否安装成功 :ps -ef | grep ssh
开启sshd服务 :service sshd start
开启sshd服务 :/bin/systemctl start sshd.service
查看sshd服务的网络连接情况:netstat -ntlp
登录的时候,如果是centos,你在服务器上登录,他就显示是centos,但是实际的用户名不是centos,是你登陆进去后的名字。
如果遇到这样的情况就是我上面说的。
正确的链接;
;
chkconfig 开机自启
chkconfig servicename on/off
将 sshd 设置为开机自启动
chkconfig sshd on
如果这个服务没有被添加进chkconfig
chkconfig --add sshd
要查询当前自启动的服务
chkconfig --list
要查看指定的服务
chkconfig --list 服务名
修改 /etc/rc.d/rc.local 这个文件
vim /etc/rc.d/rc.local
例如将 apache、MySQL、samba、svn 等这些服务的开机自启动问题一起搞定:
/usr/sbin/apachectlstart
/etc/rc.d/init.d/mysqldstart
/etc/rc.d/init.d/smbstart
/usr/local/subversion/bin/svnserve-d
参考文献:
https://blog.csdn.net/qq_40606798/article/details/82286273
Linux 上安装 Node.js
wget https://nodejs.org/dist/v10.16.0/node-v10.16.0-linux-x64.tar.xz // 下载
tar xf node-v10.16.0-linux-x64.tar.xz // 解压
cd node-v10.16.0-linux-x64 // 进入解压目录
解压文件的 bin 目录底下包含了 node、npm 等命令,我们可以修改linux系统的环境变量(profile)来设置直接运行命令:
老规矩先备份,养成修改重要文件之前先备份的好习惯。
cp /etc/profile /etc/profile.bak
然后vim /etc/profile,在最下面添加 export PATH=$PATH: 后面跟上node下bin目录的路径
export PATH=$PATH:/root/node-v10.16.0-linux-x64/bin
立即生效
source /etc/profile
[root@localhost ~]# node -v
v10.16.0
python3.8.1 环境搭建
1
wget https:
/
/
www.python.org
/
ftp
/
python
/
3.7
.
0
/
Python
-
3.7
.
0.tgz
3、解压Python-3.7.0.tgz
1
tar
-
zxvf Python
-
3.7
.
0.tgz
4、建立一个空文件夹,用于存放python3程序
1
mkdir
/
usr
/
local
/
python3
5、执行配置文件,编译,编译安装
1
2
3
cd Python
-
3.7
.
0
.
/
configure
-
-
prefix
=
/
usr
/
local
/
python3
make && make install
安装完成没有提示错误便安装成功了
6、建立软连接
ln -s /usr/local/python3/bin/python3.8 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3.8 /usr/bin/pip3
作者:树根朽木