Quantcast
Channel: Active questions tagged mount+fstab - Ask Ubuntu
Viewing all articles
Browse latest Browse all 699

How to append a line to /etc/fstab via ssh [duplicate]

$
0
0

I have a hdd automount program written.

The software uses ssh in order to issue requests against the target machine.The Idea is that a newly installed hdd is automatically added to fstab.

I have gotten everything working to the point where the fstab line enty is ready to be appended to the file.

I am trying to append like this in my software:

command.RunCommandSudo($"echo \"{mountstring}\" >> /etc/fstab");

resulting in an ssh query of the following format:

sudo echo "UUID=X /mnt/test ext4 defaults 0 1" >> /etc/fstab 

=> Permission denied

how would be an apropriate way? I doubt the apropriate way for an automated software would be to go through a text editor such as nano?


Viewing all articles
Browse latest Browse all 699

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>