Adding a share point to a directory on Mac Server - macos

I want to be able to access my SVN repositories in /usr/local/repos as a share point ... When im in the mac File Sharing panel i cant see the /usr directory in the browse screen ... can i create a directory next to Applications etc etc called Repositories and link it to /usr/local/repos so that i can add it as a share point?
Can someone show me how i can do that?
Cheers,

Best way would be to add /usr/local/repos to your smb.conf file manually.
Open up terminal, and type sudo pico /private/etc/smb.conf
Type in your password.
Inside the config file that opens, add a new section for the share you wish to add.
Example:
[Repositories]
comment = Repositories
path = /usr/local/repos
guest ok = yes
create mode = 0700
writeable = yes
browseable = yes
Save and exit the file with Control+O then Control+X.
Restart Windows File Sharing in System Preferences by turning it off and on.

Are you using OS X Server, or just the file sharing capability built into the standard version of OS X?
If it's standard OS X and you're configuring share points in System Preferences -> Sharing -> File Sharing -> Shared Folders, selecting invisible folders is actually quite easy: click the + button to add a new folder, and then press Command+Shift+. and it'll show invisible files in the select dialog.
If you're using OS X Server, it's actually somewhat harder. I don't know of any way to get Server Admin to show invisible items in its File Sharing section, but you can make the /usr folder visible with the command sudo chflags nohidden /usr, then configure sharing, then rehide it with sudo chflags hidden /usr.

Related

openssh windows bad owner or permissions

I've installed openssh for windows and when I run ssh localhost I get
Bad owner or permissions on C:\Users\gary/.ssh/config
I've looked at these 2 questions https://superuser.com/questions/348694/bad-owner-or-permissions-error-using-cygwins-ssh-exe and https://serverfault.com/questions/253313/ssh-returns-bad-owner-or-permissions-on-ssh-config but none of the answers work for me. sshd is running as a service as the Local System user. I've run chmod 0600 C:\Users\gary\.ssh\config and chown gary C:\Users\gary\.ssh\config. I've also cleared the ACL by running setfacl -b C:\Users\gary\.ssh\config and then chmod 0600 C:\Users\gary\.ssh\config again. I've also tried changing the owner to SYSTEM and got the same error.
I'm not sure what else to do, is there anything wrong with my setup? I also have git installed which installed mingw, I deleted ssh and sshd from my git installation so they wouldn't be on my path.
Other commands I've run are
icacls "C:\Users\gary\.ssh\config" /setowner gary
chown -R gary:1049089 C:\Users\gary\.ssh
ls -la C:\Users\gary\.ssh\config shows
-rw-r--r-- 1 gary 1049089 229 Jan 3 14:43 'C:\Users\gary.ssh\config'
it keeps showing this even after changing the owner to SYSTEM, but in the file properties in file explorer it shows SYSTEM as the owner
This started popping up immediately after I created another user with Administrator privileges, and that account began inheriting access to my .ssh folder.
You do not need to change your permissions whatsoever.
Just go to .ssh, right-click Properties, Security Tab, Advanced. DISABLE INHERITANCE, then click on the Administrator user (the one that is not you) and Remove them. Apply. Done.
Use ssh client from Git instead of Windows inbuilt SSH client. E.g. set VS Code to use C:\Program Files\Git\usr\bin\ssh.exe instead of C:\Windows\System32\OpenSSH\ssh.exe.
Steps:
In VS Code navigated to [File] -> [Preferences] -> [Settings] -> Search remote.ssh.path
Input C:\Program Files\Git\usr\bin\ssh.exe
Alternatively:
Update PATH environment variable to point to Git bin before Windows System32.
Type "env" in Start bar to edit System (or account) environment variables.
Select Path and hit edit.
Add C:\Program Files\Git\usr\bin\ssh.exe to the list and move it to the top of the list.
Just got same issue after re-install windows. And easily fixed just by changing the file permissions to
SYSTEM & Administrators - Full Control
[your username] - Modify & as Owner
Note:
I'm still using Windows 10 built-in SSH client C:\Windows\System32\OpenSSH\ssh.exe & not using cygwin at all
For those still struggling with this, check this out: https://github.com/PowerShell/openssh-portable/pull/418. This was the case for me. It turns out that your computer should be named differently from your username... 🤷‍♂️ It will probably be fixed soon in future updates, because fix got into commit.
So again: if your computer name is the same as your username and you still haven't fixed this issue with permissions dialog, then probably renaming your computer could help.
Instead of using the properties box, you can use the one liner:
icacls .ssh /grant:r <yourUserName>:f /inheritance:r
/grant:r username:f -> grant and overwrite permissions, giving full permissions to username
/inheritance:r -> remove inherited permissions
Keep known_hosts writable with
icacls .ssh/known_hosts /grant:rw <username>:f /inheritance:r
I'm not sure what version of Windows you're running, but since this is recent I'd guess Windows 10. I recently found out that an OpenSSH client is installed by default as of the April 2018 update. I then found I had two instances of OpenSSH: the one I installed myself and the one Windows gave me. Uninstalling the one I had installed caused the error message you describe.
The solution that worked for me was to remove the user-installed OpenSSH as well as the C:\Users\username\.ssh folder, and let Windows 10 OpenSSH create the folder when you run the command the next time. I didn't have any configuration I was worried about losing, but if you do I'd suggest copying and pasting the contents of the files somewhere and recovering them afterwards.
Hope this helps!
Having the exact same issue today, this is how I solved it:
Go to C:\Users\username.ssh
Right-click the config file
Properties -> Security -> Advanced -> Disable Inheritance -> Disable
inheritance -> Remove all inherited permissions from this object ->
Apply -> Yes -> Ok -> Ok
Use FixUserFilePermissions.ps1 to fix permissions of client side files - keys and config files of current user.
git clone git#github.com:PowerShell/openssh-portable.git
cd openssh-portable/contrib/win32/openssh
.\FixUserFilePermissions.ps1 -Confirm:$false
On windows server this is due to permission problem. Need to remove access to other users for the following folders
.ssh - folder
Right click on this folder -> Select "Give access to" - > Click on "Remove Access"
Right click on this folder -> Select "properties" - > "Securities" - > Click on "Edit Permissions" - Remove other users except the ID you are logged in.
Repeat the same process for the folder under which you have .pem file. (Note: Keep .pem file in a separate folder)
For anyone, who still has troubles after applying the owner + modify (plus full control for admins): it did not work for me. Then I saw a solution to remove all other users (incl all admins), which did not help either.
This worked for me:
leave System and Administrators in place, with full control, as suggested above
leave the user itself in place, as owner, with modify, as suggested above
however, remove any other user or group. You probably need to go to advanced first, to disable inheritance of rights
after I removed an administrative user who was added by Windows after entering my folder (by passing through the UAC box), it worked for me again.
Hope this helps for anyone who encounters this specific issue :-)
If User is in Administrative group just keep configuration in
c:\programdata\ssh\ssh_config instead %USERPROFILE%.ssh\config, will work
after disabling inheritance, make sure you add your current user, else u cannot edit the file
For me it was fixed by running chmod 0644 config under ~/.ssh/. Earlier it was set to 755 which was causing "Bad owner or permissions on /home/home/.ssh/config"
I tried all the solutions above, and sadly still can't fix this issue. I'm pretty sure the permission of my ssh config is correct, this has been verified by the Explore GUI and the Get-Acl commands.
Then I finally find a way to solve it:
delete the entire .ssh folder and then open powershell and type ssh localhost. It will create a new .ssh folder for you, then you can apply the above permission tweaks(for me I only did one thing: disable inheritance).
So if other solutions doesn't work for you, maybe you can try this. Hope it's helpful.
PS: don't forget to backup your old .ssh folder before deleting it.
I was having this problem, and no amount of changing permissions or disabling inheritance on the config file would fix it. It turned out that it did not like my computer name and user name being the same, so I re-named my computer, allowed open ssh to re-create the config file, and the permissions are now correct. That was probably a bad idea to begin with, tbh.
I deleted C:\Users\user/.ssh/config and reran my stuff, then it worked.
However, if you have something valuable there, make a backup first, just in case!
After a domain change over, I started having this same problem. Went through all of the suggestions listed and nothing worked, including both chmod and chown solutions.
I ended up fixing the problem by copying the folder, pasting it, deleting the original, and then renaming it back to .ssh.
The problem seems from the files are owned/has-permission for more than one user.
1- Go to your ./ssh folder and for both config & id_rsa files. From the properties -> Security -> Advanced:
2- Make sure that the user that you are logged in with IS the only user there.
No group change or whatever,the first answer is right.Change to git ssh.exe
How?
uninstall win10's openssh in Settings
add path of git's ssh.exe to your Path
For me it was fixed by running chmod 0644 config under ~/.ssh/ when running WSL.
Rename the config file to something like config2
Open this file with notepad
Save As config (original name)
This worked for me.
I guess it was caused by the wrong path expression.
Bad owner or permissions on C:\Users\gary/.ssh/config
The /.ssh should be \.ssh. So I try to use git bash (the terminal tool when install git in Windows system) to run ssh command. It really works. But I don't really know if it is caused by the reason I guessed.
Hi guys after a troubleshoot for a day I found that this "m.. f.." config file should not stand in the .ssh/ path.
For VSCODE just set the config in 'C:\ProgrmaData\ssh\ssh_config' path as proposed in the second choice of the palette command, and forget .shh path for this configuration.
That worked fine for me.
Nota: there was also a known_host file also created here with strange VM names inside, I deleted also this file. and that helps
For me, re-editing the permission settings in Windows is too complicated. Regenerating another configuration in vscode does not work either.
I set a custom config file path to solve this problem.
["Remote SSH: Config file"]
The absolute file path to a custom SSH config file.
note: search this option by #ext:ms-vscode-remote.remote-ssh,ms-vscode-remote.remote-ssh-edit config file
This is because the config file cannot be accessed normally. We can create a new config file (this file needs to be accessible normally), such as D:/.ssh/config, and then specify the configuration file through the -F option: ssh -F D:/.ssh/config username#ip_address -p port
Delete the .config file, it has worked for me

Where is IntelliJ IDEA config stored in OSX?

As part of a corporate workstation compliance effort, our IT department had to create a new user account for me on my Mac and left the old account until I transition all the artifacts and configs. So my old home directory was /Users/firstlast and the new one is /Users/flast. Of course, the burden of reconfiguring my environment fell on me.
Some of the apps that I use, such as ssh, Maven, Dropbox and DBeaver have their config conveniently and cleanly stored in the home directory (.ssh, .m2, .dropbox, .dbeaver, respectively) so migrating those was a cakewalk just copying the directory from the old home to the new using sudo and then chown. However, that is not the case with IntelliJ IDEA.
My IDEA was heavily customized to the extent that I would like to avoid doing it all over again if by all means possible. I understand that each project has its own config in the project directory but what I am after is to get the same list of projects to open when I launch IDEA under the new user as I did under the old user. All my projects were in ~/DEV (so ~/DEV/project1, ~/DEV/project2, etc and I can just copy the DEV directory from the old home to the new.
Where is this list of projects stored? I imagine it is somewhere in /private/etc or /private/var but permissioned to the old user so the new user does not see it.
This Jetbrains documentation lists where the important directories are:
http://devnet.jetbrains.com/docs/DOC-181
On Mac OS X IDEA uses the following directories:
Config: ~/Library/Preferences/IntelliJIdeaXX
System: ~/Library/Caches/IntelliJIdeaXX
Plugins: ~/Library/Application Support/IntelliJIdeaXX
Logs: ~/Library/Logs/IntelliJIdeaXX (starting from IntelliJ IDEA 9.0, older versions keep logs under System location)
While each project has its own config contained within the project directory, what you really want is when you first launch IDEA to get the same list of projects to choose from as before and just copying project directories will not do that.
Here are three easy steps to do it:
If your projects were in located in your old home directory, copy them into the new home directory and chown them to the new user. If they were located outside your old home directory, all you will need to do is chown them to the new user.
sudo cp -r /Users/${OLD_USER}/Library/Preferences/IdeaIC13 /Users/${NEW_USER}/Library/Preferences
sudo chown -R ${NEW_USER} /Users/${NEW_USER}/Library/Preferences/IdeaIC13
Ta-da-da. Open your IDE and it looks identical as before.

copy OSX file with permissions

I have an OSX FTDIUSBSerialDriver.kext file for an FTDI Chipset Driver where the Info.plist file has been modified for optimum performance.
I would like to supply the modified file to users of our hardware, so that it can be copied to: MacHD/System/Library/Extensions/ and it must have "system" ownership and permissions.
What would be the easiest way to:
Copy the working FTDIUSBSerialDriver.kext file (package) retaining the current ownership and priveleges for distribution ?
Provide the user with "simple" terminal instructions on how to copy and overwrite the file to MacHD/System/Library/Extensions/ with system ownership and permissions ?
Every time I try and test, the permissions and ownership get set to the current user so the driver will not load at startup.
It would be optimal if I could bundle this as a simple installer, so the user could just double click to install.
Thanks
Peter
Edit: Needs to work on 10.6.8 and above. I am aware of a finder option in OS X 10.8 that allows for "duplicate exactly" and "paste exactly", but this is not an option for everyone.
you can use cp -p
-p Cause cp to preserve the following attributes of each source
file in the copy: modification time, access time, file flags, file
mode, user
ID, and group ID, as allowed by permissions. Access Control Lists (ACLs) and Extended Attributes (EAs), including resource
forks, will
also be preserved.
We are using a script to alter the FTDIUSBSerialDriver.kext file: See: https://github.com/arminbw/wiretouch/blob/master/perl/modify-ftdi-driver-settings.pl
However, did you by any chance experience problems after upgrading to 10.10? See: Patched FTDIUSBSerialDriver kext has to be unloaded/reloaded after reboot (OSX 10.10). Any ideas?

What folder on Mac is writeable without admin access but readable by all users?

I'm looking for a place to save my app's license file. I want it in a location that's accessible by all users so if one user on the machine activates the app, the app is also activated for every other user. However, I don't want to require elevation to write to this location.
On Windows, I use C:\Users\Public. Is there an equivalent on OS X?
Thanks!
You can make any directory you own publicly accessible by allowing it with chmod. For instance:
mkdir ~/Public
chmod 755 ~/Public
will create and make world-readable the directory /Users/YourName/Public

error when i want to save java file in jdk/bin

when i save java file error is you dont have permission to save in this location contact the administrator to obtain permission on window7
Don't store application data in the "Program Files" directory.
It is very bad design and regular users don't have write access to that directory (for a very good reason).
So even if you changed your settings locally to open up the door for viruses your application won't run on other computers.
Besides: storing a Java file in the JDK directory serves no purpose at all.
Btw: your uppercase letters are broken, as well as the dot or the comma...
That's normal - jdk/bin is the installation directory of the JDK, regular users cannot (and should not) write files there. You'll have the same problem on Linux/Unix and on Mac OS X, where installation directories are off-limits to regular users.
Write your files to the users home directory (System property "user.home", works across platforms), or let the user choose where you save stuff.
Bin directory do not allow directly to save program in it.
it is so simple, just save your .java file on desktop and then copy paste it in Bin. done ;)
If the file can't save directly to c:\program files\java\jdk1.8.0\bin\
Solution:-
Click start Menu type Notepad command in run run as administrator
Right click the Notepad run as Administrator, then type the program file can save directly to c:\program files\java\jdk1.8.0\bin\
Just try it......

Resources