Hi, is it possible to copy a file to a remote linux server from my openhab-linux-server?
I know ssh and scp command, but they need ssh-key authentication.
Is this possible to remove this and perhaps give full write-access to only one directory on my remote machine?
If this is not working or this would be to critical because of security, what about samba-shares?
It is all inside my private network, how can i do this?
If they are both Linux systems one method would be, nfs mount.
Basically, you setup an nfs share on the machine you want to copy to. Then you nfs mount on the machine you want to copy from. If shared correctly the connection will happen at boot up and appear as a local directory to the openHAB machine.
Other option is openhabian hasn’t samba shares setup if you use this image. You could mount it on the remote system and monitor for a file to appear.
ssh and scp can both be used without key authentication. It would be much easier to be helpful if you’d provide details on what you are trying to achieve rather than how you want to achieve it .
You can add your own public key in the authorize_keys on the other machine. You can the scp and ssh without password.
I had an sip ip-doorphone. When someone pressed the “ringing” button, all my phones inside my house ringed and i was able to speak with the visitor.
But my ip-doorphone died. I only used the ringing-functionality. I nearly never spoke with the visitor.
So it would be enough, when i only have a ringing-button. --> Thats no problem. I already have one and it works. I can see the switch on my openhab-sitemap switched, when someone presses the button.
But i want to have my phones ringing again, because i have no extra bell, but phones all around the house - also i could take the phone to the garden and can hear, when someone is pressing the doorbell.
So i looked how i can do that with asterisk and i can do it - i have to place a simple text file to an asterisk directory - then the phones will ring.
I have 2 linux debian servers inside my house. One is openhab and another one is asterisk.
Can i remove authentication completely in this case or is this no good idea (security risk)? All is inside my internal network only.
That makes sense, but why the requirement to remove authentication? It does not take much to setup the keys. Is it a security risk? Probably not, but the effort to work around it is going to be about the same as just using it. There are several posts in the forum on how to set it up.
Even in an internal network I would not remove the need to authenticate completely. If you do not want to setup authentication with keys you can still use the scp command and provide the password of the remote user as a parameter.
You also could use netcat to copy files between systems without providing a password nor a key. For examples see https://nakkaya.com/2009/04/15/using-netcat-for-file-transfers/ .
I always would go for ssh. The setup of a public/private keypair is just a few seconds.
As the private key will not be secured by a passphrase as a script will trigger copying the files between your systems it is good to know how to secure a key pair in a way that is can be used for copying files ( for a dedicated command ) only: https://research.kudelskisecurity.com/2013/05/14/restrict-ssh-logins-to-a-single-command/
On top of this it can be restricted to a dedicated IP address.