Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

chown comand probloms.


  • Please log in to reply
5 replies to this topic

#1 ksharp117

ksharp117

  • Members
  • 3 posts
  • OFFLINE
  •  
  • Local time:01:37 AM

Posted 06 July 2018 - 02:18 AM

Hello all.

trying to go threw this tutorial https://www.bleepingcomputer.com/forums/t/598615/a-simple-beginners-guide-to-setting-up-a-samba-share/

I'm on the second step trying to change the ownership of the Shares file from root to user, I'm typing chown /home/Shares pi:pi but I keep getting "chown: invalid user: '/home/Shares'

not sure what I'm doing wrong, pretty new to linux. Thanks in advance for any help.



BC AdBot (Login to Remove)

 


#2 Al1000

Al1000

  • Global Moderator
  • 7,979 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Scotland
  • Local time:08:37 AM

Posted 06 July 2018 - 04:18 AM

Hi, please post the output of this command:
echo $USER
EDIT: Nevermind, please see below.

Edited by Al1000, 06 July 2018 - 04:36 AM.


#3 rufwoof

rufwoof

  • Members
  • 131 posts
  • OFFLINE
  •  
  • Local time:08:37 AM

Posted 06 July 2018 - 04:22 AM

​Its more usual for 'nix to have the source of commands first, target last. I would have expected the command to be chown pi:pi /home/Shares


OpenBSD (-release) data server (that auto detects and rsshfs mounts one of its folders onto my desktop system).

Desktop system sshfs mounts my android phone (SSHelper app installed on phone).

Desktop system runs X under non-root, and is mostly booted read only (desktop changes lost at shutdown/reboot).


#4 Al1000

Al1000

  • Global Moderator
  • 7,979 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Scotland
  • Local time:08:37 AM

Posted 06 July 2018 - 04:35 AM

^ Good point. That will be the problem. I've edited the tutorial accordingly.

#5 Mike_Walsh

Mike_Walsh

    Bleepin' 'Puppy' nut..!!


  • Members
  • 1,414 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:King's Lynn, UK
  • Local time:08:37 AM

Posted 06 July 2018 - 01:58 PM

​Its more usual for 'nix to have the source of commands first, target last. I would have expected the command to be chown pi:pi /home/Shares

 

Same with creating sym-links with

ln -s

....I believe. Original 'source' file first, then 'target'.

 

@ksharp117:-

 

Don't forget the '-R' (the 'recursive' argument) if you want the chown command to apply to any directories/files on the next level down.

chown -R pi:pi xxx/xxx/xxx

Capital 'R', not a small one. That gives a different meaning entirely.

 

The GNU/Linux 'man' page for chown might be useful to read...

 

https://linux.die.net/man/1/chown

 

 

Mike.  :wink:


Distros:- Multiple 'Puppies'..... and Anti-X 16.1

My Puppy BLOG ~~~  My Puppy PACKAGES

Compaq Presario SR1916UK; Athlon64 X2 3800+, 3 GB RAM, WD 500GB Caviar 'Blue', 32GB Kingspec PATA SSD, 3 TB Seagate 'Expansion' external HDD, ATI Radeon Xpress 200 graphics, Dell 15.1" pNp monitor (1024 x 768), TP-Link PCI-e USB 3.0 card, Logitech c920 HD Pro webcam, self-powered 7-port USB 2.0 hub

Dell Inspiron 1100; 2.6 GHz 400FSB P4, 1.5 GB RAM, 64GB KingSpec IDE SSD, Intel 'Extreme' graphics, 1 TB Seagate 'Expansion' external HDD, M$ HD-3000 'Lifecam'.

 

KXhaWqy.gifFQ8nrJ3.gif

 

 


#6 rufwoof

rufwoof

  • Members
  • 131 posts
  • OFFLINE
  •  
  • Local time:08:37 AM

Posted 08 July 2018 - 06:22 AM

Just a word of caution. -R recursive setting of permissions has to be used with great care. 'nix file/folder ownerships and permissions typically have been carefully selected/set by developers such that they all pull together along with user/group settings to make a complete whole. Setting even just one files ownership/permissions incorrectly could invalidate the entire standard system security, little different to a potential exploitable bug in a system file that might open up privilege elevation (compromised system). The capitalised R option is a means to reduce the risk of unintended usage of recursion. And generally you should only ever look to perhaps use that when being applied to files/folders under /home (your own files/folders, none of the system files/folders).


OpenBSD (-release) data server (that auto detects and rsshfs mounts one of its folders onto my desktop system).

Desktop system sshfs mounts my android phone (SSHelper app installed on phone).

Desktop system runs X under non-root, and is mostly booted read only (desktop changes lost at shutdown/reboot).





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users