LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I change Owner/Group programmatically in Labview Linux RT (PXIe-8822) ?

Solved!
Go to solution

After building the program, if I copy a specific file using the "FileZilla" Tool, a permission error occurs when reading or writing that file. (directory : /home/lvuser/natinst/bin)

When using the "FileZilla" Tool, Owner/Group changes to admin/administrators.

So, I used the "Set Permission" function to change this to lvuser/ni, but a permission error also occurred.

 

In the putty tool, it works well with the "chown" command after logging in as admin.

So, I ran "chown" using "System Exec.vi", but a permission error also occurred.

 

So, I followed the procedure by referring to the following blog content, but the error still occurs.

 https://blog.sasworkshops.com/crio-tips-running-linux-command-as-root-from-labview/

** When I run "opkg install sudo", return message is "No packages installed or removed."

    lvuser ALL=(ALL) NOPASSWD: ALL has been added to the "/etc/sudoers" file.

 

I sincerely hope for help from experts !!

 

 

0 Kudos
Message 1 of 3
(102 Views)
Solution
Accepted by topic author Goodtimes

@Goodtimes wrote:

After building the program, if I copy a specific file using the "FileZilla" Tool, a permission error occurs when reading or writing that file. (directory : /home/lvuser/natinst/bin)

When using the "FileZilla" Tool, Owner/Group changes to admin/administrators.

So, I used the "Set Permission" function to change this to lvuser/ni, but a permission error also occurred.

 

In the putty tool, it works well with the "chown" command after logging in as admin.

So, I ran "chown" using "System Exec.vi", but a permission error also occurred.

 

So, I followed the procedure by referring to the following blog content, but the error still occurs.

 https://blog.sasworkshops.com/crio-tips-running-linux-command-as-root-from-labview/

** When I run "opkg install sudo", return message is "No packages installed or removed."

    lvuser ALL=(ALL) NOPASSWD: ALL has been added to the "/etc/sudoers" file.


Linux is different than Windows where Microsoft still has to deal with users being used to change everything on their machine (if they aren’t member of a domain). 
Your Filezilla program is set to login with admin account and that causes all files you create to be admin owned. Your LabVIEW app runs under a different user lvuser, which has more limited rights in order that your LabVIEW app can’t easily blow up the system. 
There are multiple solutions and some are worse than others. The best would be to login as lvuser with Filezilla but that might require adjustments under the Linux system of who can login through FTP. FTP being an insecure protocol is usually restricted to admin only as an admin can nuke the system anyhow if he wants or doesn’t know enough. Better would be to use a more secure protocol like WebDAV.

Or you could reconfigure the lvuser account on the Linux system to be part of the admin group. This lets your application do pretty much anything including blowing up your installation. So it really should not be done on a production system. It also might make certain services fail as your LabVIEW app now creates admin right files that those services are not prepared to handle.

 

Basically, don’t use FTP and login as normal user when remoting into the Linux box, not as admin!

Rolf Kalbermatter
My Blog
0 Kudos
Message 2 of 3
(74 Views)

First of all, thank you for your answer.

I searched for various information about Webdav on the Internet.

 

As a result, I may not understand the details exactly, but I was able to successfully connect to the Linux RT system using the Network drive connection function supported by the Windows operating system.

As a result of using this to download/upload the file on File Explorer, the Owner/Group was set to webserv/ni and there were no problems reading or writing.

 

Thank you for your help. !! 

0 Kudos
Message 3 of 3
(36 Views)