by davemc » Wed Aug 01, 2007 20:34
Ashley wants to get Samba working. Samba=the devil!
1) Give sshfs a shot. Its secure and blazing fast. You can also do regular ssh and ssh -X via Putty in Windows/Linux. Very simple ssh is
$ssh loginusername@server
-loginusername is the name you use to login to the ssh server account. Can be whatever account you already have on that server system.
-server is the server. You can use the IP of it or the dot com if you have one.
To take it further, you can even long in to specific filesets.
$ssh loginusername@server:/home/loginusername/whatever
Sshfs is a fusemount over ssh. Simple as that. To get that done you need both ssh client and fuse setup on your machine, and ssh server and fuse setup on the server...
$sshfs loginusername@server:/home/loginusername/whatever /mnt/mountpount
-loginusername@server:/home/loginusername/whatever = as above with ssh
-/mnt/mountpoint = the mountpoint you have setup on your machine. This can be a file you create (mkdir /home/mountpoint, or /mnt/mountpoint) that you want mounted, etc.
If youve done all that right, then you will see a mountpoint appear on your desktop with instant access to the servers files over a secure ssh fuse.
Ssh and thus, sshfs is going to authenticate. This means passwords, each time you do it. You can avoid this by sharing rsa keys. This is easy to do if you follow that sshfs wiki.
-cd $HOME
-make your rsa.pub key.
-sftp into your server as above with ssh TO the ~/.ssh file.
-put rsa.pub, etc.
-quit
-ssh into server and cd to ~/.ssh
-cat rsa.pub >> authorized_keys
-logout
Done!
Test this by ssh back into the server again. It should not ask for a password and just log you right on in.
Now you need to setup your /etc/fstab to automount. Again, could not be easier! Follow that wiki, as my mini "how to" is not entirely complete as im going off memory here.
After setting up your mountpoint in fstab, test by running mount /mnt/mountpoint and your mount should appear on your desktop after it logs into the server.
Phew.. Ok now on to evil Samba.
Sabayons smb.conf file is an absolute catastrophe IMO. I did the fun thing and deleted it. I then copied and pasted the smb.conf from my Ubuntu server (which is the proper way to setup smb.conf) and all works like it should! In theory you only need 3 or 4 lines in that file to get things working correctly. Many, many samba guides out there including the samba projects site. Many people say you have to have your accounts and smbpasswd setup correctly on all your machines, so that all machines have a common account username and password. This is not entirely correct, as I have zero extra accounts setup on my home lan of 7 machines, and samba works flawlessly on my 5 line smb.conf setup. The problem lies with how default smb.conf sets up authentication, etc. for security purposes. Its not wrong, but its a mess. Anyway, Samba (CIFS) is not the optimal way to network for either windows or Linux. Many alternative methods out there (NFS, sshfs, fuse, ssh -X, vnc, putty).
That indeed is the fun of Linux though. You learn and learn and learn and its fun!