kali2021-root-login和ssh问题、不能粘贴问题等彻底解决

kali最新版解决GNOME桌面root用户登录问题
首先安装kali一个gnome桌面最新版
然后启动使用
首先普通用户登录
然后修改root密码

sudo passwd root
1
切换用户

su root
1
2.然后修改两个配置文件

vim /etc/pam.d/gdm-autologin
将配置文件找到这一行:
auth required pam_succeed_if.so user != root quiet_success
然后给它添加注释变成:
#auth required pam_succeed_if.so user != root quiet_success


3.第二个配置文件

vim /etc/pam.d/gdm-password

找到这一行:
auth required pam_succeed_if.so user != root quiet_success
然后给它添加注释变成:
#auth required pam_succeed_if.so user != root quiet_succes

4.reboot
重启登录
OK
成功


至入sourceCRT连接ssh,试了很多方法终于搞定:
vim /etc/ssh/sshd_config
以下都开启状态,特别最后两行:
Port 22
ListenAddress 0.0.0.0

PermitRootLogin yes

PubkeyAuthentication yes

ChallengeResponseAuthentication no

UsePAM yes

X11Forwarding yes
PermitTTY yes
PrintMotd no

AcceptEnv LANG LC_*

Subsystem       sftp    /usr/lib/openssh/sftp-server

HostKeyAlgorithms=+ssh-rsa,ssh-dss

KexAlgorithms diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group1-sha1,curve25519-sha256@libssh.org



----------------------------------------------------------
解决vi打开后不能粘贴到kali linux文件中的问题:
方法一这种方法每次打开文件都要
进入vim命令行模式,输入:
:set mouse=c   #进入Command-line 模式
然后就可以正常粘贴复制了。

第二种方法永久的在root下新建立个文件:
root@kali:~# vi .vimrc

" Vim config file.
 
 
" Global Settings: {{{
syntax on                           " highlight syntax
filetype plugin indent on           " auto detect file type
 
set nocompatible                    " out of Vi compatible mode
"set number                          " show line number
set numberwidth=3                   " minimal culumns for line numbers
set textwidth=0                     " do not wrap words (insert)
set nowrap                          " do not wrap words (view)
set showcmd                         " show (partial) command in status line
set ruler                           " line and column number of the cursor position
set wildmenu                        " enhanced command completion
set wildmode=list:longest,full      " command completion mode
set laststatus=2                    " always show the status line
set mouse=                         " use mouse in all mode
set foldenable                      " fold lines
set foldmethod=marker               " fold as marker 
set noerrorbells                    " do not use error bell
set novisualbell                    " do not use visual bell
set t_vb=                           " do not use terminal bell
 
set wildignore=.svn,.git,*.swp,*.bak,*~,*.o,*.a
set autowrite                       " auto save before commands like :next and :make
set cursorline
set hidden                          " enable multiple modified buffers
set history=1000                     " record recent used command history
set autoread                        " auto read file that has been changed on disk
set backspace=indent,eol,start      " backspace can delete everything
set completeopt=menuone,longest     " complete options (insert)
set pumheight=10                    " complete popup height
set scrolloff=5                     " minimal number of screen lines to keep beyond the cursor
set autoindent                      " automatically indent new line
set cinoptions=:0,l1,g0,t0,(0,(s    " C kind language indent options
set clipboard+=unnamed              " shared clipboard
set noexpandtab                     " do not use spaces instead of tabs
 
set tabstop=4                       " number of spaces in a tab
set softtabstop=4                   " insert and delete space of <tab>
set shiftwidth=4                    " number of spaces for indent
set expandtab                       " expand tabs into spaces
set incsearch                       " incremental search
set hlsearch                        " highlight search match
set ignorecase                      " do case insensitive matching
set smartcase                       " do not ignore if search pattern has CAPS
set nobackup                        " do not create backup file
"set noswapfile                      " do not create swap file
set backupcopy=yes                  " overwrite the original file
 
set encoding=utf-8
set termencoding=utf-8
set fileencoding=utf-8
set fileencodings=gb2312,utf-8,gbk,gb18030
set fileformat=unix
 
set background=dark
"colorscheme SolarizedDark_modified 
"colorscheme wombat_modified
" gui settings
if has("gui_running")
    set guioptions-=T " no toolbar
    set guioptions-=r " no right-hand scrollbar
    set guioptions-=R " no right-hand vertically scrollbar
    set guioptions-=l " no left-hand scrollbar
    set guioptions-=L " no left-hand vertically scrollbar
    autocmd GUIEnter * simalt ~x " window width and height
    language messages zh_CN.utf-8 " use chinese messages if has
endif
 
" Restore the last quit position when open file.
autocmd BufReadPost *
    \ if line("'\"") > 0 && line("'\"") <= line("$") |
    \     exe "normal g'\"" |
    \ endif
"}}}
 
" Key Bindings: {{{
let mapleader = ","
let maplocalleader = "\\"
 
" map : -> <space>
map <Space> :
 
" move between windows
nmap <C-h> <C-w>h
nmap <C-j> <C-w>j
nmap <C-k> <C-w>k
nmap <C-l> <C-w>l
 
" Don't use Ex mode, use Q for formatting
map Q gq
 
"make Y consistent with C and D
nnoremap Y y$
 
" toggle highlight trailing whitespace
nmap <silent> <leader>l :set nolist!<CR>
 
" Ctrl-E to switch between 2 last buffers
nmap <C-E> :b#<CR>
 
" ,e to fast finding files. just type beginning of a name and hit TAB
nmap <leader>e :e **/
 
" Make shift-insert work like in Xterm
map <S-Insert> <MiddleMouse>
map! <S-Insert> <MiddleMouse>
 
" ,n to get the next location (compilation errors, grep etc)
nmap <leader>n :cn<CR>
nmap <leader>p :cp<CR>
 
" Ctrl-N to disable search match highlight
nmap <silent> <C-N> :silent noh<CR>
 
" center display after searching
nnoremap n   nzz
nnoremap N   Nzz
nnoremap *   *zz
nnoremap #   #zz
nnoremap g*  g*zz
nnoremap g#  g#z
"}}}
 
" mru
let MRU_Window_Height = 10
nmap <Leader>r :MRU<cr>
 
" taglist
let g:Tlist_WinWidth = 25
let g:Tlist_Use_Right_Window = 0
let g:Tlist_Auto_Update = 1
let g:Tlist_Process_File_Always = 1
let g:Tlist_Exit_OnlyWindow = 1
let g:Tlist_Show_One_File = 1
let g:Tlist_Enable_Fold_Column = 0
let g:Tlist_Auto_Highlight_Tag = 1
let g:Tlist_GainFocus_On_ToggleOpen = 1
nmap <Leader>t :TlistToggle<cr>
 
" nerdtree
let g:NERDTreeWinPos = "right"
let g:NERDTreeWinSize = 30
let g:NERDTreeShowLineNumbers = 1
let g:NERDTreeQuitOnOpen = 1
nmap <Leader>f :NERDTreeToggle<CR>
nmap <Leader>F :NERDTreeFind<CR>
 
"paste
vmap <C-c> "+y
nmap <C-v> "+p
set pastetoggle=<F12>
 
"C,C++ Java Compile and run by F5
map <F5> :call CompileRunGcc()<CR>
func! CompileRunGcc()
    exec "w"
    if &filetype == 'c'
        exec "!g++ % -o %<"
        exec "! ./%<"
    elseif &filetype == 'cpp'
        exec "!g++ % -o %<"
        exec "! ./%<"
    elseif &filetype == 'java' 
        exec "!javac %" 
        exec "!java %<"
    elseif &filetype == 'sh'
        :!./%
    endif
endfunc
 
"C,C++ debug
map <F8> :call Rungdb()<CR>
func! Rungdb()
    exec "w"
    exec "!g++ % -g -o %<"
    exec "!gdb ./%<"
endfunc
  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

项目工程师余工

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值