The general issue is that if I create or modify any file or directory with sudo then it seems that I'm unable to create and modify this file or directory further as any other user than sudo. The rest of this below is me elaborating on that issue.
It seems to me that I need to be sudo in order to do some things in ubuntu, for example, I can't seem to mount a server without being a super user, so I'm mounting a server like this:
sudo smbmount //server-address /media/netmap -o user=username,domain=domainname
and I've tried tacking on this bit about the user id and group id, but to no avail
sudo smbmount //server-address /media/netmap -o user=username,domain=domainname,rw,uid=zallenlab,gid=zallenlab
I am using this line from the terminal because I need to enter a password, by password for the server for one thing, not the sudo password, and I can't seem to get this to work by modifying the fstab file, even if I explicitly include my password in the file. And from the terminal, removing sudo, or trying just 'mount', neither of these things work for me, just the line that I pasted above (both commands have the same result, tacking on that bit about uid doesn't do anything).
Additionally, Ive noticed something weird, that when I use the sudo command to do something like to try to create an archive of a directory, or to run rsync to do some updates, this changes the permissions of all associated dirs to being accessible to sudo only. That is really weird to me. What is the use of this type of system? I must be doing something really wrong here.
This is a problem for me because then everything I do after this point needs to be sudo in order to access files, modify them, delete, or make new files and/or folders. That is a huge pain in the ass. I run into similar issues with calling programs from scripts. It seems that sometimes if I call a program from a script it will not have read and write permissions of some files in some places. I think this is all stemming from the sudo issue. I am the only user of this machine. I think in most cases there really is one user per machine. I'm on the verge of just figuring out how to log on as a sudo account permanently from start to finish, but I see all these warnings about that not being a good idea and that I should ask the ubuntu community before doing this, so I'm posting my question now. Please help.
Basically, I want to be able to run scripts that can do very basic things like back up files (make zip archives of directories both locally of local files, and on a server of the server files), update files by comparing directories from local to server folders, and I am moving around and creating quite a bit of files through matlab as well. I don't think it's so complicated what I'm trying to do, but I'm having a real hard time sorting out this permissions issue. Seems like it is coming up with everything that I do.