Buffalo Forums

Products => Storage => Topic started by: loi.dangthanh on July 16, 2015, 11:24:10 PM

Title: Can I working with Buffalo NAS from linux shell?
Post by: loi.dangthanh on July 16, 2015, 11:24:10 PM
Hi guys, I'm using Buffalo NAS LS-VL Linkstation.
Everything work pretty well with creating group, user, and shared folder by using Web Access  :)
But I need to do these stuff with linux shell, so that i can do them all automatically with bash script.
I've done the following steps in sequence:
1. ssh into LS-VL as root
2. create my own user
useradd ftpuser1 -g hdusers -s /bin/bash
passwd ftpuser1 ## And then type my password

3. create folder for ftpuser1

mkdir /mnt/disk1/ftpuser1
chown -R root:root /mnt/disk1/ftpuser1
chmod 777 /mnt/disk1/ftpuser1

4. Modify proftpd config file (Well, I wish to use my folder for ftp purpose only)

vi /etc/proftpd/proftpd.conf
#Adding my own directory
<Directory /mnt/disk1/ftpuser1>             
  <Limit ALL>                                 
    DenyAll                                   
    AllowUser ftpuser1                         
  </Limit>                                     
  <Limit READ>                                 
  </Limit>                                     
  <Limit WRITE>                               
    Order deny,allow                           
    AllowUser ftpuser1                       
  </Limit>                   
</Directory>

5. Modify /etc/init.d/ftpd.sh to make sure my /etc/proftpd/proftpd.conf not generated when I restart proftpd service

configure()
{
        if [ -f /etc/linkstation_release ]; then
                ......
                ## /usr/local/sbin/nas_configgen -c proftpd ## I comment this line out
               ......
        fi
        sync
        sleep 1
}

6. Restart proftpd service
/etc/init.d/ftpd.sh restart

Well, after 6 these step, i can login into my ftp server with user ftpuser1, and then upload or download file inside directory /mnt/disk1/ftpuser1, despite user 'ftpuser1' and directory '/mnt/disk1/ftpuser1' do not present on the NAS Web Access
But life's not that easy for me. After restarting NAS, my user 'ftpuser1' came useless, I recognize that the directory I added in step 4 gone permanently, and the script /etc/init.d/ftpd.sh I edited in step 5 restore to it's origin as well.

I know that there's some script run at NAS's startup and these have some standard configuration, like /usr/local/sbin/nas_configgen does, but i dont know what or where it is.

I also have no idea where NAS store user account information created from Web Access.

Last question: Do we have any API built for interacting with Buffalo NAS? or Web Access is the only way?

Any help would be appreciated.

Best Regards

Loi Dang
Browser ID: smf (is_webkit)
Templates: 1: Printpage (default).
Sub templates: 4: init, print_above, main, print_below.
Language files: 1: index+Modifications.english (default).
Style sheets: 0: .
Hooks called: 45 (show)
Files included: 27 - 1055KB. (show)
Memory used: 741KB.
Tokens: post-login.
Queries used: 10.

[Show Queries]