Permissions

貨物執行 - 權限被拒絕磷稀土_在一世ü_小號LY磷R和在一世這在小號大號是PREVIOUSLYrust 安裝 - 權限被拒絕

  • January 23, 2019

我已經安裝了 rustcurl https://sh.rustup.rs -sSf | sh並按照其中的說明進行操作。安裝成功,PATH添加.bash_profile如下:

export PATH=$HOME/.cargo/bin:$PATH

echo$PATH顯示變數已正確設置,如下:

rust@rusty:~$ echo $PATH
/home/rust/.cargo/bin:/usr/local/bin:/usr/bin:/bin:/usr/games

/home作為一個單獨的分區安裝並通過/etc/fstab如下方式安裝

# Mounting home partition
/dev/sda4                 /home                 ext4      rw,async,users      0 0

我最初有noexec作為選項之一。但是,刪除它並沒有給結果帶來任何變化。

我懷疑我的預設/home分區權限,但沒有任何其他 linux 執行框可以驗證。

total 20
drwx------  2 root     root     16384 Jan 18 08:38 lost+found
drwxr-xr-x 22 rust     rust     4096  Jan 19 19:45 rust

這個權限正確嗎?

如果有人可以闡明我缺少注意/做錯了什麼以及如何解決和解決問題,將不勝感激。

在@kusalananda 發表評論後實現

編輯-1

rust@rusty:~$ cargo
bash: /home/rust/.cargo/bin/cargo: Permission denied

它應該提示我提供幫助文件,cargo但未能說出上述內容。

EDIT-2.cargo添加了和 的權限.cargo/bin

rust@rusty:~$ ls -l .cargo/
total 8
drwxr-xr-x 2 rust rust 4096 Jan 19 18:45 bin
-rw-r--r-- 1 rust rust   37 Jan 19 18:58 env
rust@rusty:~$ ls -l .cargo/bin/
total 108560
-rwxr-xr-x 10 rust rust 11116056 Jan 19 18:45 cargo
-rwxr-xr-x 10 rust rust 11116056 Jan 19 18:45 cargo-clippy
-rwxr-xr-x 10 rust rust 11116056 Jan 19 18:45 cargo-fmt
-rwxr-xr-x 10 rust rust 11116056 Jan 19 18:45 rls
-rwxr-xr-x 10 rust rust 11116056 Jan 19 18:45 rustc
-rwxr-xr-x 10 rust rust 11116056 Jan 19 18:45 rustdoc
-rwxr-xr-x 10 rust rust 11116056 Jan 19 18:45 rustfmt
-rwxr-xr-x 10 rust rust 11116056 Jan 19 18:45 rust-gdb
-rwxr-xr-x 10 rust rust 11116056 Jan 19 18:45 rust-lldb
-rwxr-xr-x 10 rust rust 11116056 Jan 19 18:45 rustup

編輯-3

>> curl https://sh.rustup.rs -sSf | sh
info: downloading installer

Welcome to Rust!

This will download and install the official compiler for the Rust programming 
language, and its package manager, Cargo.

It will add the cargo, rustc, rustup and other commands to Cargo's bin 
directory, located at:

 /home/rusty/.cargo/bin

This path will then be added to your PATH environment variable by modifying the
profile files located at:

 /home/rusty/.profile
 /home/rusty/.bash_profile

You can uninstall at any time with rustup self uninstall and these changes will
be reverted.

Current installation options:

  default host triple: x86_64-unknown-linux-gnu
    default toolchain: stable
 modify PATH variable: yes

1) Proceed with installation (default)
2) Customize installation
3) Cancel installation
>1

info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: latest update on 2019-01-17, rust version 1.32.0 (9fda7c223 2019-01-16)
info: downloading component 'rustc'
79.5 MiB /  79.5 MiB (100 %) 883.2 KiB/s ETA:   0 s                
info: downloading component 'rust-std'
54.3 MiB /  54.3 MiB (100 %) 611.2 KiB/s ETA:   0 s                
info: downloading component 'cargo'
 4.4 MiB /   4.4 MiB (100 %) 761.4 KiB/s ETA:   0 s                
info: downloading component 'rust-docs'
 8.5 MiB /   8.5 MiB (100 %) 553.6 KiB/s ETA:   0 s                
info: installing component 'rustc'
info: installing component 'rust-std'
info: installing component 'cargo'
info: installing component 'rust-docs'
info: default toolchain set to 'stable'

 stable installed - (error reading rustc version)


Rust is installed now. Great!

To get started you need Cargo's bin directory ($HOME/.cargo/bin) in your PATH 
environment variable. Next time you log in this will be done automatically.

To configure your current shell run source $HOME/.cargo/env

問題是/etc/fstab我的條目。在我改變安裝方式後它起作用了。這是我的新fstab條目:

/dev/sda4            /home/rusty            ext4            defaults            0  2

我將所有者和組更改為/home/rustyrusty並且它起作用了。

引用自:https://unix.stackexchange.com/questions/495451