728x90


I will explain how to change the Python version.

By default the Python version is 2.7

Option Description:
'--config python' 
 - Python version change option
'--install [symbolic link path] python [real path] number'
 - Register the version.

Do the following:
1) '$ sudo update-alternatives --config python'
 - If no alternative is set, nothing is displayed.

2) '$ sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1'
    '$ sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.6 2'
 - Register Python 2.7 and 3.6 versions.

3) '$ sudo update-alternatives --config python'
 - Enter '$ sudo update-alternatives --config python' again to open the version selection menu.

4) '2'
 - Since we are using 3.6, enter 2.

5) '$ python --version'
 - Check that the desired Python version is set.

728x90
728x90

DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.



2.7 is not supported, so you have to upgrade to 3.x.


'ls /bin | grep python' to check if there is a 3.X version.

[--@------- ~]$ ls /bin | grep python
pmpython
python
python2
python2.7

If there is no 3.X version, type sudo yum install python3 to install the 3.X version.

[--@------- ~]$ sudo yum install python3

Installed:
  python3.x86_64 0:3.6.8-18.el7

Dependency Installed:
  python3-libs.x86_64 0:3.6.8-18.el7        python3-pip.noarch 0:9.0.3-8.el7         python3-setuptools.noarch 0:39.2.0-10.el7

Complete!


Check the version.

[--@------- ~]$ python --version
Python 2.7.5

[--@------- ~]$ python3 --version
Python 3.6.8

[--@------- ~]$ ls /bin | grep python
pmpython
python
python2
python2.7
python3
python3.6
python3.6m

 

Now you need to change to the Python 3.6 version you have installed.
https://clear-sky-sun.tistory.com/142

 

[Linux] change python version

I will explain how to change the Python version. By default the Python version is 2.7 Option Description: '--config python'  - Python version change option '--install [symbolic link..

clear-sky-sun.tistory.com





728x90
728x90
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-gqE7md/dash/
You are using pip version 8.1.2, however version 21.3.1 is available.
You should consider upgrading via the 'pip install --upgrade pipcomman

 

curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py

 

728x90
728x90

The linux I use doesn't have pip

 

Use the yum repolist command to check if epel is installed.

- If the was installed, it will appear as below.

 

- If it is not installed, type 'sudo yum install python-pip'.

 

Now install pip.

 

Check if pip is installed.

728x90
728x90

 is not in the sudoers file.  This incident will be reported.
- root 권한이 없어서 sudo 명령으로 접근 할때, (name) is not in the sudoers file.  This incident will be reported. 메시지 발생.


해결 방법
- (name)에 root 권한을 줘야 합니다.

728x90
728x90

W

w : 현재 시스템에서 로그인 사용자 및 사용자들의 작업 내용을 보여준다.

명령어 위치 : /usr/bin/w

w 명령어를 통하여 알수 있는 정보들
1)
서버 현재 시각 정보
2)
서버 부팅한 이후 시스템 작동 시간
3)
서버 접속자 전체 수
4)
서버 접속자 별 서버 평균 부하율 정보
5)
서버 접속자 별 접속 계정명
6)
서버 접속자 별 TTY
7)
서버 접속자 별 접속한 IP
8)
서버 접속자 별 로그인 시각 정보
9)
서버 접속자 별 CPU 사용 정보(JCPU, PCPU)
10)
서버 접속자 별 현재 사용 명령어 정보

w
명령어
w -o : JCPU PCPU
에 대한 내용 출력이 없다.


[test@jcode ~]$ w
10:01:03 up 20:51,  2 users,  load average: 0.00, 0.01, 0.05
USER     TTY      FROM           LOGIN@   IDLE   JCPU   PCPU  WHAT
test      pts/0    111.111.111.111   09:22      7.00s   0.04s   0.03s  w
test1     pts/1    222.222.222.222   09:14      13:12   0.31s   0.31s  -bash

load average : 세 숫자가 1, 515분 동안 실행 대기 중인 프로세스 평균 개수고 낮으면 좋다.
             
숫자가 높을 경우 과부화 상태이며, 1분은 1.00이 잠깐 넘어도 괜찮음.
             
하지만, 515분 평균이 1.00을 넘는다면 시스템 점검하는게 좋다.             
              (0.00 :
일이 없어 편안한 상태 | 0.70 : 문제 확인 해야한다. | 1.00 : 당장 해결 상태)
             
시스템 코어 개수에 따라 가장 좋은 Load 값이 결정된다.
                     (
아래 명령어로 코어 개수 확인 가능하다.)
[test@jcode ~]$ grep name /proc/cpuinfo | wc -l (
명령어 코어 개수 확인 가능)

USER : 로그인 한 사용자
TTY :
터미널 유형을 보여준다. Console 모드로 접속 했을 경우에는 ttyn으로 표시.
     
외부에서 텔넷으로 접속하였을 경우 pts/0 pts/1 형식으로 보여준다.
FROM :
어디에서 접속 하였는지 알 수 있다. Domain이나 IP가 표시되며, 하이픈(-) 형식이라면
       
로컬의 콘솔 모드에서 접근하였다.
LOGIN@ :
언제 시스템에서 들어왔는지 보여준다.
IDLE :
최종 명령 수행 후 대기시간
JCPU : Job cpu
시간을 말하며, TTY 필드에서 사용하는 장치명에서 모든 프로세스 CPU 총 시간
       -
지난 백그라운드 실행되는 시간 제외, 현재 백그라운드 실행 시간은 포함
PCPU : Process cpu
시간을 말하며, WHAT 필드에 나타나는 프로세스에서 사용하는 CPU 총 시간
WHAT :
현재 사용 중인 쉘이나 작업 등 나타낸다.

 


who

who : 현재 시스템에 로그인하고 있는 사용자 리스트

명령어 위치 : /usr/bin/who

[
test@jcode ~]# who
test1 pts/0        2020-07-15 07:36 (110.111.222.111)
test1 pts/1        2020-07-15 09:20 (110.111.222.111)
boe  pts/2       2020-07-15 13:19 (220.111.222.333)
kce  pts/4       2020-07-14 20:26 (123.232.551.115)

 


users

users : 현재 시스템에 로그인 한 사용자 이름 출력

명령어 위치 : /usr/bin/users

[test@jcode ~]# users
test1 test1 boe kce


728x90

'Linux' 카테고리의 다른 글

[Linux] pip install  (0) 2022.01.20
is not in the sudoers file. This incident will be reported.  (0) 2022.01.19
root에서 user 계정으로 전환 방법  (0) 2020.06.14
sudo su 차이점  (0) 2020.06.14
root 사용자 비밀번호 찾는 방법  (0) 2020.06.12
728x90

su - (user 계정)

728x90
728x90

sudo?

현재 계정에서 다른 계정의 권한만 빌립니다.


su?

다른 계정으로 변경합니다.


su -?

다른 계정의 환경 변수도 적용 됩니다.

728x90
728x90

Linux를 사용 하다 오랜만에 사용 할 경우, root 비밀번호가 생각이 안날 때가 있습니다.

그래서 준비했습니다.

Linux root 비밀번호 찾기!! 그런건 없습니다.

밀고 새로 설치하면 됩니다. 하지만 만약 그럴 수 없다면.... 비밀번호를 변경 하여 사용 할 수 있습니다.

지금부터 시작하겠습니다.


1) 먼저 Linux를 실행 합니다. 전 Fedora라 사용 중이니, Fedora라고 하겠습니다.
    Fedora가 시작되고, 빠르게 I키를 누르겠습니다. 마치... 바이오스 진입 하는 것 처럼요.
2) Fedora에 커서가 있는데, 있는 상태에서 E키를 누릅니다. E는 Edit 의미
3) 키보트를 이용하여 kernel /vmlinuz -.. 로 옴긴 후, E키를 누릅니다.
4) 다른 화면으로 나타난다면, 맨 끝으로 옴긴뒤 Space를 누른다
5) 한칸이 띄워 졌기 때문에, 1을 써주고 엔터 누른다.
    - rhgb quiet 1 이렇게 되게 1은 런레벨 1~5 중 하나이다. 1 런레벨은 단일 사용자 모드
6) 다음화면으로 넘어가면 B를 눌러 부팅한다.
7) 단일 사용자 모드로 부팅되며, 로그인은 안뜨고, 바로 root로 로그인 되어있다.
8) root는 비번을 몰라도 변경 할 권한이 있기 때문에, passwd 입력하여 새로운 비밀번호를 만든다.
9) reboot 명령어를 입력하여 재부팅한다.

GRUB 자체를 편집 할 수 없게 해야한다.
CMOS 암호를 통해 하드웨어 보안도 할 수있다. 


참조
뇌를 자극하는 리눅스 서버 네트워크

728x90

+ Recent posts