Linux

Debian

全局环境变量配置

配置位置

  • login shell
    • /etc/profile
    • /etc/profile/*
  • non-login shell
    • ~/.bashrc
    • /etc/profile/*
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# 编辑/etc/profile.d/env.sh
vim /etc/profile.d/env.sh
# 添加环境变量(Hadoop为例)
export HADOOP_HOME=/hadoop-3.2.3
export PATH=$PATH:$HADOOP_HOME/bin
export PATH=$PATH:$HADOOP_HOME/sbin
# 加载一次/etc/profile
source /etc/profile
# 编辑~/.bashrc
vim ~/.bashrc
# 添加代码
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
source ~/.bashrc

SSH

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# 下载ssh
apt-get install -y openssh-server
# 启动ssh
/etc/init.d/ssh start
# 设置密码
passwd
# 修改配置文件
vim /etc/ssh/sshd_config

PermitRootLogin yes
# 重启ssh服务
/etc/init.d/ssh restart


# 无密码登录
ssh-keygen -t rsa
# 获取共钥
cd /root/.ssh/
# 将公钥发送给其他机器
ssh-copy-id root@bigdata



10.211.55.27 bigdata1
10.211.55.28 bigdata2
10.211.55.29 bigdata3

黑洞

/dev/null

1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/bash
if [ $# -lt 1 ]
then
echo "No Args Error"
exit;
fi

for i in bigdata1 bigdata2 bigdata3
do
echo ":::: $host $i ::::"
ssh $i "$*"
done

Linux
http://docs.mousse.cc/Linux/
作者
Mocha Mousse
发布于
2024年11月26日
许可协议