August 8, 2012

6 things you probably want to do after Solaris 10 installation

1. Set BASH as default shell for root:
This is first thing I really do! Because bash has multiple advantages for day to day use and scripting too, over other shells.
For this you can simply edit /etc/passwd file and change the shell from very first line.
By default it is /sbin/sh, you can change it to /bin/bash

2. Change the hostname from "unknown"
To change the hostname temporarily:
 hostname SERVER01  
To change the hostname so that it is persistent across reboots:
 echo SERVER01 > /etc/nodename  
However, the changed hostname is re-set when you run sys-unconfig command to reset the configuration of the system.

3. Disable GUI Login:
 /usr/dt/bin/dtconfig -d  
For more, see here about disabling and enabling GUI login in Solaris

4. Configure loghost:
You might get messages such as "loghost could not be resolved.". To be able to resolve loghost you must configure DNS Server or you can add entry in /etc/hosts such as "127.0.0.1  loghost".

5. Disable sendmail:
You can disable sendmail by issuing a simple command,
 svcadm disable sendmail  
Hmm... not everybody uses sendmail... 

6. Set PS1 variable (This is only for people using BASH):
It is solely user's choice to set this variable. Solaris has it as PS1='\s-\v\$ ' by default.
However, I set it as PS1="$LOGNAME@$HOSTNAME# " so that it will be displayed as:
 root@SERVER01# _  
For more information on PS1 environment variable check here and to make it look like Angelina Jolie :D check here.

Labels: , , ,

August 4, 2012

Solving basics hell out of vsftpd

Configuring vsftpd isn't a very hard thing. If you haven't read the docs, then its crucial to go.

I had a fresh installation of vsftpd on CentOS 6.2
I tweaked hardly one or two params in /etc/vsftpd/vsftpd.conf such as "anonymous_enable=NO"
Then created a new user using:

 #useradd -m -d /home/user1 -s /bin/bash user1  

Then I tried to connect to the server using our brand new user1.
Here's what I got:
500 OOPS: cannot change directory :/home/user1

After a bit digging on Google and thanks to this link, I was able to do it when I ran following command:

 /usr/sbin/setsebool -P ftp_home_dir 1  

This command takes a while to run, but it worked for me after that.
The setsebool sets boolean variables in SELinux.

Labels: , , , , , , ,

June 30, 2012

Swapping your droid device with your Friend's!


Ever wondered why Android devices are better than any apple devices running iOS? There are many reasons, I have got one more for you. You can easily swap your devices by just performing following procedure.

Checklist before swapping your phone/tablet with your friend's:
1. Make sure you backup all your SD Card data by connecting it to PC before performing any of the steps below.
2. Make sure you have at least 1 GB of free space on your SD Card.
3. Make sure you have >30% of battery remaining. Its better to keep on AC charging.

What is recommended?
1. To have your contacts synced up with your Google Account.
2. Root.
3. Clockworkmod Recovery.
4. Not all Phone apps work with Tabs and vice versa. Its better to swap a phone with a phone and tablet with a tablet.

What this article does not cover?
1. Understanding what is android.
2. What is root and how to do it?
3. What is Clockworkmod, how do I install it and who is Koush? (BTW he's the  developer of CWM)
4. Backing up your system settings like "Saved WiFi networks","Ringtone and Volume settings" etc. It is neither recommended and does not always work.

Here is a simple swap process:
1. Backup Device1, Device2.... Devicen using backup flowchart below.
2. Connect devices to computer. Copy all files from SD Card of each device to a folder on your PC.
3. WARNING! MAKE SURE YOU HAVE ALL YOUR DATA BACKED UP! Now Format your device. To do this, go to Settings => Privacy => Factory Data Reset. Make sure you also format the USB Storage.
4. Restore is simply inverted backup process. Just copy the data you have backed up to SD Card and then restore it using respective apps. That's it!
5. Make your iPhone friends jealous after buying me a chocolate.


Backup:


A:
Download and Install "Titanium Backup" from Google Play. Grant it root access  when it asks for. Then backup your apps using screens below.





Titanium Backup Creates a folder "/mnt/sdcard/Titanium Backup" and stores its backups in it. You can use Cloud Services to store your data too if you purchase the app.

B:
Contacts are backed up with Google Account automatically. If this is not happening with you, you must check sync options.
When you add any new contacts to the phone, they should be chosen to store on your "Google Account" and not "Phone" or "SIM". Also, the Contacts sync option must be checked in Settings=>Accounts and Sync to make sure they sync with Google Servers.
However, if you do not wish to sync contacts with Google, there are plenty other options available.
I recommend using "Super Backup" search for "com.idea.backup.smscontact" in Google Play.

C:
You can use "Super Backup" mentioned above to backup Call Logs too.
As other option, I've been using "Call Logs Backup and Restore" "com.riteshsahu.CallLogBackupRestore" since a Year and its good.

D:
You can use "Super Backup" mentioned above to backup SMS too. As other option, I've been using "SMS Backup and Restore" "com.riteshsahu.SMSBackupRestore" since a Year and its good.

E:
I am not pretty sure about backing up apps with data in non rooted phones. Use "MyBackup" "com.rerware.android.MyBackup" to backup apps. However I haven't tested it.

N:
Root process varies with devices. You can search Google simply like "root HTC One X". Still, If you are unable to find it, just drop me a comment below with device model, I would love to search it for you.

Restore:
Restoring is as simple as Backup. This is pretty straightforward, usually, every app that you used for backup, creates a folder with its name and its files and directories in it. You just have to copy them to respective device and restore it.

Labels: , , ,

June 5, 2012

Disabling default GUI Startup Solaris 10

Many of us may not want to use the Solaris 10 Default JAVA or KDE default GUI. To startup Solaris 10 default in command Line mode you can make use of one of following:

1. You can use dtconfig command:
To disable GUI:
#/usr/dt/bin/dtconfig -d
To enable GUI:
#/usr/dt/bin/dtconfig -e
2. Disable/enable Service that handles cde-login:
To disable GUI:
#svcadm disable svc:/application/graphical-login/cde-login:default
To enable GUI:
#svcadm disable svc:/application/graphical-login/cde-login:default

It is that simple. No defense.

Labels: , , ,

May 13, 2012

Enabling Remote root login Solaris 10.

It is neither recommended nor suggested to allow remote root logins for security reasons.
For Test servers, Non-production servers or other servers, you may want to allow remote root login via SSH.

Usually you get "Access denied" errors when accessing a Solaris server as root when logging on remotely.

You just have to edit two entries in two files.

First:
/etc/default/login

Comment the following line in /etc/default/login by putting a # sign before the line.

 CONSOLE=/dev/console  

This will enable remote root logins to the system.

Second:
/etc/ssh/sshd_config

Comment the following line in /etc/ssh/sshd_config by putting a # sign before the line.

 PermitRootLogin no  

Then add the following line just below the above line.

 PermitRootLogin yes  

This will enable remote SSH and SCP Logins to the system.

Labels: , , , , ,

April 22, 2011

Devoted to duty, sysadmin cartoon

Just saw a cartoon on web how sys admin is devoted to his work...
courtesy-yonitg.com

Labels: