After installed Centos 6.7 for CISCO WAE, I found python version is 2.6 that is much older, and I need ansible1.9, but Centos default upgrade to ansible2.2… in order to easy management ansible1.9 that is python package, I plan to install PIP. From official website, suggest not use 2.6 under pip, so I need to upgrade python to 2.7 too.
But I found WAE use 2.6 after I succeed upgrade python to 2.7…Summarized the totally steps that will help me review in future.
MacOS:Documents frank$ cd citra/
MacOS:citra frank$
MacOS:citra frank$
MacOS:citra frank$ export Qt5_DIR=$(brew --prefix)/opt/qt5
MacOS:citra frank$ export MACOSX_DEPLOYMENT_TARGET=10.9
MacOS:citra frank$ mkdir build
MacOS:citra frank$ cd build
MacOS:build frank$ cmake .. -GXcode
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:36 (project):
No CMAKE_C_COMPILER could be found.
CMake Error at CMakeLists.txt:36 (project):
No CMAKE_CXX_COMPILER could be found.
-- Configuring incomplete, errors occurred!
See also "/Users/frank/Documents/citra/build/CMakeFiles/CMakeOutput.log".
See also "/Users/frank/Documents/citra/build/CMakeFiles/CMakeError.log".
2. Change language
gedit /etc/default/locale –> change what do you want
reboot
3. Script couldn’t run on linux “bad interpreter: No such file or directory”
that should dos format, need change to unix format
vi xxx
check format by “:set ff” or “:set fileformat”
change format by “:set ff=unix” or “:set fileformat=unix”
:wq
4. Enable ssh service
sudo apt-get install openssh-server
gedit /etc/ssh/sshd_config –> “PermitRootLogin yes”
restart by “/etc/init.d/ssh restart”
check by “ps -ef|grep ssh”
reboot
5. Disable firewall
check whether enable by “ufw status”
disable by “ufw disable”
[root@bird-162 ~]# sed -i 's/lo:1/internet/g' route-internet
[root@bird-162 ~]# more route-internet
1.0.0.0/24 dev internet
1.0.4.0/22 dev internet
1.0.4.0/24 dev internet
1.0.5.0/24 dev internet
tar -cvf test-tar.tar nvgen_traces >>> create test folder to zip file
tar -xvf test-tar.tar >>> extract tar file
zip -r 661-yang.zip yang
unzip 661-yang.zip
client:~ frank$ cd .ssh
client:.ssh frank$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/frank/.ssh/id_rsa):
Enter passphrase (empty for no passphrase): <<< 真实环境建议增加密码
Enter same passphrase again:
Your identification has been saved in /Users/frank/.ssh/id_rsa.
Your public key has been saved in /Users/frank/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:3zinN8lMY79WaSRDzbaBLQsT4KSlb9MDwrQfFc9FK+o frank@client
The key's randomart image is:
+---[RSA 3072]----+
| . +.+o *o |
| o B .oo+.*.|
| * + +++.o|
| + + .+.o |
| S= + + .|
| ..oo= o.|
| +Eo+.. |
| +* o |
| .. o.. |
+----[SHA256]-----+
client:.ssh frank$ ls -l
total 120
-rw-r--r-- 1 frank staff 751 May 11 2020 config
-rw------- 1 frank staff 2610 Feb 24 11:59 id_rsa <<< 私钥
-rw-r--r-- 1 frank staff 578 Feb 24 11:59 id_rsa.pub <<< 公钥
-rw------- 1 frank staff 23022 Feb 23 19:25 known_hosts
-rw-r--r--@ 1 frank staff 23377 Feb 22 21:00 known_hosts.old
拷贝的Server端
Frank@Yongs-MacBook-Pro ~ % ssh-copy-id -p 8080 -i ~/.ssh/id_rsa.pub [email protected]
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/Users/Frank/.ssh/id_rsa.pub"
The authenticity of host '[10.114.251.163]:8080 ([10.114.251.163]:8080)' can't be established.
ED25519 key fingerprint is SHA256:xxxxxxx
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
[email protected]'s password:
Number of key(s) added: 1
Now try logging into the machine, with: "ssh -p '8080' '[email protected]'"
and check to make sure that only the key(s) you wanted were added.
[root@localhost ~]# more ~/.bashrc
# .bashrc
# User specific aliases and functions
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias TG26='telnet 172.16.211.154 32897'alias PR11='telnet 172.16.211.154 32907'
alias PR12='telnet 172.16.211.154 32908'
root@f0-13:~# ftp
ftp> open x.x.x.x 11111
Connected to x.x.x.x.
220 frank-server FTP server ready.
Name (x.x.x.x:root): xxx
331 Password required for xxx.
Password:
230 User xxx logged in, access restrictions apply.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> pas
Passive mode on.
% sudo more /etc/sudoers
......
# root and users in group wheel can run anything on any machine as any user
root ALL = (ALL) ALL
%admin ALL = (ALL) ALL
xxx ALL = (ALL) ALL
[root@frank ~]# more /etc/cron.d/sysstat
# Run system activity accounting tool every 5 minutes
*/5 * * * * root /usr/lib64/sa/sa1 1 1
# 0 * * * * root /usr/lib64/sa/sa1 600 6 &
# Generate a daily summary of process accounting at 23:53
53 23 * * * root /usr/lib64/sa/sa2 -A
查看SAR
只列几种常用的命令,具体可以通过-h查看更多option:
[root@frank ~]# sar -u #这里的信息是从二进制文件中读取的
Linux 4.10.4-1.el7.elrepo.x86_64 (frank) 08/09/2023 _x86_64_ (1 CPU)
01:57:57 AM LINUX RESTART
02:00:01 AM CPU %user %nice %system %iowait %steal %idle
02:10:01 AM all 1.34 0.00 0.50 0.25 0.00 97.91
Average: all 1.34 0.00 0.50 0.25 0.00 97.91
[root@frank ~]# sar -f /var/log/sa/sa09 #通过sar读取二进制文件
Linux 4.10.4-1.el7.elrepo.x86_64 (frank) 08/09/2023 _x86_64_ (1 CPU)
01:57:57 AM LINUX RESTART
02:00:01 AM CPU %user %nice %system %iowait %steal %idle
02:10:01 AM all 1.34 0.00 0.50 0.25 0.00 97.91
Average: all 1.34 0.00 0.50 0.25 0.00 97.91
Refer to IOX + Freeradius article that very less on Internet and lots of IOS with Freeradius, after study that, I summarized that by follow:
1: Install freeradius
You need install free radius first, ignore the part, you can check it by yourself or check my last article <RHEL7 install freeradius>
Notes: as follow, we can assign a group for user “frank”, now priv5 is custom group, you can assign default group, e.g: Cisco-avpair = “shell:task=#netadmin,#sysadmin,#cisco-support”
Btw, you can direct defined priv15 by follow: Cisco-AVPair = “shell:priv-lvl=15”
Or direct defined cmd by follow: Cisco-AVpair = “shell:cmd=show”
If you assign cisco-support group first, and then to limit command by “cmd=show”, cmd will unavailable; and vice versa.
[root@frank radius]# more /etc/raddb/users
frank Cleartext-Password := "frank"
Service-Type = NAS-Prompt-User,
Reply-Message = "Hello!",
Login-Service = Telnet,
Cisco-AVPair = "shell:tasks*=#priv5,"