ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

Setting up static blog (based on movable type) / vm / local development system

<< < (3/3)

justice:
Guys if you are thinking of following what I have done so far: including downloading, installing and using the instructions you can get to this point in about 1.5 hours (rough guessed based on my not too fast laptop).

I'm lookin at samba next and had to reinstall so used these instructions :D

justice:
SAMBA

You will want to install the following software it:
* WinSCP - FTP / SSH file manager, to manage your files over SSH (http://winscp.net/eng/index.php)

Although it's convenient to use WinSCP to access your linux files, in other situations you will want to manipulate them as if they're just another windows network share, so you can use the context menu, edit files in your favourite editor etc. For this we need to setup a Samba File Server.

For a complete guide and more background information, bookmark the Ubuntu Documentation.
https://help.ubuntu.com/11.04/serverguide/C/samba-fileserver.html

Tip:
I recommend that if at all possible, your windows username and password and ubuntu's user and password are identical. This will transparently authenticate you to samba. Otherwise you will have to enter your username and password once each session. Not a big problem.

Install Samba and libpam-smbpass. The latter will sync your linux login credentials with samba's (shares can have their own username and password):

--- ---sudo apt-get install samba libpam-smbpass
Let's create a stripped samba configuration and edit it:

--- ---cd /etc/samba
cp smb.conf ~/backup
sudo mv smb.conf smb.conf.master
testparm -s smb.conf.master | sudo tee smb.conf
sudo nano smb.conf && sudo restart smbd && sudo restart nmbd

Delete the [printers] and [print$] sections completely.

Then at the end of [global] add:

--- Code: Text ---security = user        encrypt passwords = true [homes]        comment = Home Directories        browseable = yes        valid users = %S        read only = no
This exposes user's home directories and will let only those users access them.

The following might not be necessary, but I've had a bit of trouble with incorrect credentials being saved before, so just to be on the safe side we will turn off the VM:


--- ---sudo poweroff
Close the VM. Reboot your windows pc, and restart the VM again.

Try browsing to \\<server>\<username> (in my case: \\devvy\sander) . In your home directory, create a new text document with a few words. Now in the SSH session list the contents of the folder it is in:


--- ---ls -al ~

If everything is working correctly the username that owns the textfile is your linux user. This means you will not have any strange permission issues later on.

Congrats you can now read and write to your home directory.

justice:
Passwordless logon

In windows, start PuttyGen, click Generate.
Enter a Key Passphrase and remember it - otherwise you won't be able to login.
If you plan on storing it on Dropbox so that you can use it from another location, please install BoxCryptor first. It will create a new driveletter for an encrypted dropbox folder that only you can read. You can securely store private keys there.

Save the public key as hostname.pub and your private key as hostname.ppk (never allow anyone to copy this).
Double click on your hostname.ppk and enter the passphrase to import the private key.
Copy your public key into your ubuntu home directory (that's why we have setup samba!).

create the folder holding your ssh keys:

--- ---mkdir ~/.ssh
ssh-keygen -i -f hostname.pub > ~/.ssh/authorized_keys

Now. close any putty sessions.
Load up your connection and navigate to Connection > SSH > Auth > Browse (under Authentication parameters) and select your private key.
Under Connection > Data > "Auto login username" you can enter your username to completely automate login.

Don't forget to go back to Session and save the changes. Now login. If everything works you should not have to enter your password.

Optionally, we can now disable logging in via password. You can still login to your system using the Ubuntu login screen if you ever lose your keys.


--- ---cp /etc/ssh/sshd_config ~/backup
sudo /etc/ssh/sshd_config && sudo service ssh restart

Search for PasswordAuthentication and change it from yes to no
Search for UsePAM and change it from yes to no

Verify you cannot login without a key, using the windows command prompt:


--- ---ssh <user>@<hostname> -p 2222

Accept the host certificate.
enter a password, you should receive:

Permission denied (publickey).

Congratulations, your logins are now secure and more convenient.

justice:
Let's get a working outgoing email system working next.
If you want to set it up like me you will require a gmail.com mail account, but you should be able to adapt this to any existing email setup pretty easily.

We will setup a simple satellite system using postfix and then send an email using mutt. Let's install mutt (which installs postfix)


--- ---sudo apt-get install mutt
Now the postfix setup wizard starts. If you want to reconfigure postfix at a later date you can run sudo dpkg-reconfigure postfix


--- ---Type of mail server : Satellite System
Mail Name : example.org (the name you want on your outbound mail)
SMTP relay host : smtp.gmail.com
Postmaster : blank
Other destinations : blank
Synchronous Queues : no
Network blocks to allow relay : default
Mailbox size : default
Local address : default
Listen Address : all

We will need to enable TLS and passwords out outgoing connections next:


--- ---cp /etc/postfix/main.cf ~/backup
sudo nano /etc/postfix/main.cf

Add the following lines at the end of the file:

--- Code: Text ---smtp_use_tls = yessmtp_sasl_auth_enable = yessmtp_sasl_password_maps = hash:/etc/postfix/sasl_passwdsmtp_sasl_security_options = noanonymoussmtp_sasl_tls_security_options = noanonymous
Create the sasl_password file by running the following (substitute username and password)

--- ---echo "smtp.gmail.com [email protected]:password" | sudo tee /etc/postfix/sasl_passwd

Apply the configuration:

--- ---sudo postmap /etc/postfix/sasl_passwd && sudo service postfix restart

Send a test email using mutt and press m for a new mail. Follow the wizard then press y to send. You should receive the mail momentarily.

That's everything I can imagine up and running, so you can now install whatever system you want :) I'll be playing about with a few projects and post more when I have settled on a system. Feedback is always welcome.

Navigation

[0] Message Index

[*] Previous page

Go to full version