ubuntu訪問windows下共享文件夾,ssh指令的使用

主要參考 https://blog.csdn.net/sumx2015/article/details/80394460

ubuntu訪問windows下共享文件夾

windows共享文件

  1. 控制面板 ->網絡共享中心->高級共享設置->啓用網絡發現
  2. 選擇要共享的文件夾,屬性,共享,選擇要共享的人或者everyone,可以到高級選項裏面設置權限。

ubuntu訪問

  1. 安裝相關的工具
sudo apt install cifs-utils
sudo apt install smbclient
  1. 查看windows的用戶名和ip
    在cmd輸入whoami得到用戶名,我的是 惠普
    在cmd輸入ipconfig得到ip,我的是 10.11.4.30
  2. 執行測試有沒有成功,如果成功就不會報錯
smbclient -L 10.11.4.30 -U 惠普
  1. 在ubuntu裏面建立共享文件夾的訪問路徑我的是/home/deepglint/MyShare/
  2. 進入root環境執行以下命令,記得輸入windows的密碼,MyShare文件夾下就有windows所共享的文件了
mount -t cifs -o username=惠普,password=xxxxxxxxx//10.11.4.30 /home/deepglint/MyShare/

ssh指令的使用

訪問:

ssh -X [email protected] -p 32108

傳文件:

1、從服務器上下載文件
scp username@servername:/path/filename /var/www/local_dir(本地目錄)

例如scp [email protected]:/var/www/test.txt 把192.168.0.101上的/var/www/test.txt 的文件下載到/var/www/local_dir(本地目錄)

2、上傳本地文件到服務器
scp /path/filename username@servername:/path

例如scp /var/www/test.php [email protected]:/var/www/ 把本機/var/www/目錄下的test.php文件上傳到192.168.0.101這臺服務器上的/var/www/目錄中

3、從服務器下載整個目錄
scp -r username@servername:/var/www/remote_dir/(遠程目錄) /var/www/local_dir(本地目錄)

例如:scp -r [email protected]:/var/www/test /var/www/

4、上傳目錄到服務器
scp -r local_dir username@servername:remote_dir
例如:scp -r test [email protected]:/var/www/ 把當前目錄下的test目錄上傳到服務器的/var/www/ 目錄

tmux終端複用

https://www.cnblogs.com/wangqiguo/p/8905081.html

  1. tmux new -s session1 新建會話
  2. ctrl+b d 退出會話,回到shell的終端環境
  3. tmux ls 終端環境查看會話列表
  4. tmux a -t session1 從終端環境進入會話
  5. tmux kill-session -t session1 銷燬會話
  6. tmux rename -t old_session_name new_session_name 重命名會話
  7. ctrl + b $ 重命名會話 (在會話環境中)

vim常見用法

https://www.cnblogs.com/zknublx/p/8795789.html

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章