How to Create a New User on Ubuntu Server?

gene_x 0 like s 565 view s

Tags: bash

  1. Restricting User 'malawi' from Installing System-wide Programs and Verifying Permissions

    chmod o-rx /home/jhuang
    ls -ld /home/jhuang
    cd /home/jhuang
    
    groups malawi
    sudo deluser malawi sudo
    
    jhuang@hamm:~$ groups malawi
    #malawi : malawi
    jhuang@hamm:~$ groups jhuang
    #jhuang : jhuang adm cdrom sudo dip plugdev lpadmin sambashare docker
    
  2. Ensuring Full Permissions for User 'malawi' in Their Home Directory

    #chmod -R u=rwx,go= /home/malawi
    ls -ld /home/malawi
    #drwxr-xr-x
    sudo chown malawi:malawi /home/malawi
    #sudo chmod 700 /home/malawi
    #sudo chmod -R 700 /home/malawi
    sudo chmod 755 /home/malawi
    sudo chmod -R 755 /home/malawi
    ls -ld /home/malawi
    
  3. Protecting Other Users' Directories from Access by 'malawi'

    sudo chmod o-rx /home/jhuang
    sudo chmod o-rx /mnt/h1/jhuang
    
    #for dir in /home/*; do
    #  if [ -d "$dir" ]; then
    #    sudo chmod o-rx "$dir"
    #  fi
    #done
    
    ls -ld /home/jhuang
    
  4. Changing User Passwords

    sudo passwd malawi
    passwd
    
  5. Changing User Passwords

    if (!requireNamespace("BiocManager", quietly = TRUE))
        install.packages("BiocManager")
    BiocManager::install("SeuratObject")
    install.packages("Seurat")
    

6.

    #(NOT GOOD) from 775 to o-rx 
    #sudo chmod o-rx /mnt/h1/jhuang
    #sudo chmod -R o-rx /mnt/h1/jhuang
    #sudo chmod o-rx /home/jhuang
    #sudo chmod -R o-rx /home/jhuang

    #from 775 to 750
    sudo chmod 750 /mnt/h1/jhuang
    sudo chmod -R 750 /mnt/h1/jhuang
    sudo chmod 750 /home/jhuang
    sudo chmod -R 750 /home/jhuang
    #END
  1. install r and r-seurat with miniconda3
    mkdir -p ~/miniconda3
    wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh
    bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3
    rm -rf ~/miniconda3/miniconda.sh
    ~/miniconda3/bin/conda init bash
    
    conda create -n r -c bioconda r r-seurat
    conda activate r
    #> .libPaths()
    #[1] "/home/malawi/miniconda3/envs/r/lib/R/library"
    if (!requireNamespace("remotes", quietly = TRUE))
      install.packages("remotes")
    remotes::install_github("satijalab/seurat-data")
    conda deactivate
    
    conda activate r
    R
    library(Seurat)
    library(SeuratData)
    library(ggplot2)
    library(patchwork)
    library(dplyr)
    

like unlike

点赞本文的读者

还没有人对此文章表态


本文有评论

没有评论

看文章,发评论,不要沉默


© 2023 XGenes.com Impressum