Chleba / netscanner

Terminal Network scanner & diagnostic tool with modern TUI
MIT License
848 stars 20 forks source link

netscanner error: Something went wrong Error: Permission denied (os error 13) #13

Closed thomasbratt closed 7 months ago

thomasbratt commented 7 months ago

sudo /home/thomasbratt/.cargo/bin/netscanner netscanner error: Something went wrong Error: Permission denied (os error 13)

Location: /home/thomasbratt/.cargo/registry/src/index.crates.io-6f17d22bba15001f/netscanner-0.4.1/src/utils.rs:148:5

ls -al /home/thomasbratt/.cargo/bin/netscanner -rwsr-xr-x. 1 thomasbratt thomasbratt 18M 2024-03-15 12:40:18 /home/thomasbratt/.cargo/bin/netscanner

ip link show 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 2: enp3s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000 link/ether 08:bf:b8:08:91:e4 brd ff:ff:ff:ff:ff:ff 3: wlp4s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DORMANT group default qlen 1000 link/ether 10:68:38:68:bf:e8 brd ff:ff:ff:ff:ff:ff

Chleba commented 7 months ago

Interesting. From the code, I can tell there is a problem with permissions to create directories. You may try to change groups or permissions (or both) to your .cargo folder. That could solve this issue. Please let me know if it was the case.

Chleba commented 7 months ago

As we can see here: https://github.com/Chleba/netscanner/blob/30e3fbb9394e397231147b34bdac966de648ae80/src/utils.rs#L148 We're calling file system function that want to create some directories. In this case data directory. You can change path of those directories in the .envrc file (https://github.com/Chleba/netscanner/blob/main/.envrc) so that it you point into a folder where your user have perrmissions.

Chleba commented 7 months ago

btw. try changing group of netscanner binary file to root:thomasbratt - that should help. Let me know how it went.

Chleba commented 7 months ago

@thomasbratt any luck?

Chleba commented 7 months ago

Because of no other pieces of information, I'm closing this issue that was happening thanks to incorrect permissions.