# set permission on two new hard drives so users can write ?

## cwc

I just put in 2 new internal 1TB hard drives in my gentoo box.

I used cfdisk to format and mkfs.ext3 /dev/sdb1 to set file system.

I changed my fstab

/dev/sdb1 	/mnt/uno ext3 	rw,users   	1 2

/dev/sdc1 	/mnt/due ext3 	rw,users 	1 2

I would like to link a directory or the entire drive to my account /home/cwc so I can write to them via ftp or smb

I'm not having any luck.  What do I set the permissions to on the drive?  My account?

eg: chmod ??? /mnt/drive1

Thanks in advance.

```

azzerare ~ # fdisk -l 

Disk /dev/sda: 320.1 GB, 320072933376 bytes

255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00097df5

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1              63      433754      216846   83  Linux

/dev/sda2          433755     1686824      626535   82  Linux swap / Solaris

/dev/sda3         1686825   625137344   311725260   83  Linux

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes

255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System

/dev/sdb1   *          63  1953525167   976762552+  83  Linux

Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes

255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x0003a2dc

   Device Boot      Start         End      Blocks   Id  System

/dev/sdc1   *          63  1953525167   976762552+  83  Linux

```

----------

## Hu

You must mount the drive, then make one or more directories on it writable to your user in the usual manner.  Make it owned by you and user writable, or make it be in your group and group writable, or make it world writable.  This last is not recommended.

----------

## cwc

 *Hu wrote:*   

> You must mount the drive, then make one or more directories on it writable to your user in the usual manner.  Make it owned by you and user writable, or make it be in your group and group writable, or make it world writable.  This last is not recommended.

 

Good.

Thank you for the help!

----------

## cwc

 *Hu wrote:*   

> You must mount the drive, then make one or more directories on it writable to your user in the usual manner.  Make it owned by you and user writable, or make it be in your group and group writable, or make it world writable.  This last is not recommended.

 

What about the /etc/fstab line:

Would you do this:

/dev/sdb1 /mnt/uno ext3 rw,users 1 2 

or this:

/dev/sdb1 /mnt/uno ext3 defaults 1 2 

or

?????

----------

## Hu

I would do /dev/sdb1 /mnt/uno ext4 defaults,nodev,noexec 1 2.  If the device is not guaranteed to be present at boot, I would add noauto,users.

----------

## cwc

 *Hu wrote:*   

> You must mount the drive, then make one or more directories on it writable to your user in the usual manner.  Make it owned by you and user writable, or make it be in your group and group writable, or make it world writable.  This last is not recommended.

 

I mounted my second drive using fstab 

I set up a directory in /mnt/due/ called due-cwc

eg:  /mnt/due/due-cwc

I then #ln-s /mnt/due/due-cwc /home/cwc/due-cwc

I   also #chown -R cwc /mnt/due/due-cwc

When I ftp I get the error when I try to change the directory:

```

cwc@azzerare ~ $ ftp 192.168.1.14

Connected to 192.168.1.14 (192.168.1.14).

220 (vsFTPd 2.3.4)

Name (192.168.1.14:cwc): cwc

530 Please login with USER and PASS.

SSL not available

331 Please specify the password.

Password:

230 Login successful.

Remote system type is UNIX.

Using binary mode to transfer files.

ftp> cd due

due/     due-cwc/ 

ftp> cd due

due/     due-cwc/ 

ftp> cd due-cwc/

550 Failed to change directory.

ftp> 

```

No luck?

----------

## Hu

Please verify it works with a regular Unix shell.  Many daemons impose extra restrictions on remote users.  Refusing to follow symbolic links is a fairly popular restriction.

Also, consider replacing ftp with something secure.

----------

## cwc

 *Hu wrote:*   

> Please verify it works with a regular Unix shell.  Many daemons impose extra restrictions on remote users.  Refusing to follow symbolic links is a fairly popular restriction.
> 
> Also, consider replacing ftp with something secure.

 

ssh within my network works fine.

Now the question is?

What protocol can I use now. 

I only have experience with ftp , ssh and smb.  

How do I move files within my network with ssh?

Thanks again!

----------

## cwc

 *Hu wrote:*   

> Please verify it works with a regular Unix shell.  Many daemons impose extra restrictions on remote users.  Refusing to follow symbolic links is a fairly popular restriction.
> 
> Also, consider replacing ftp with something secure.

 

I disabled in /etc/vsftp/vsftp.conf

#chroot_list_enable=YES

And I can access the directory.  This is not a secure fix.  But for what I am doing now it will work.

I work on another connection , but until then I'll move files on my network via ftp.

Thanks Hu!

----------

## Hu

I always use scp/sftp for file transfers.  The security may be overkill on some LAN environments, but it has the significant convenience that it is a native part of net-misc/openssh, so once ssh works, the other support is free.

----------

