Linux for Windows Server Administrators

Linux for Windows Server Admins

Create and Add Users

Add the user by typing in useradd followed by the desired login name to create. An example would be useradd sburns. This will follow with a few questions to answer and finally create the user. You should now be able to login with PuTTY.  Once logged in as the nonprivileged user, the administrator can elevate their privileges to root.

Using su – will allow a user to switch between users, even root, as long as the user knows the relevant password. The command itself is shorthand for “switch user.” As root an administrator can change to any other user by using the command su simon (or su bill or whomever), assuming the password is known. The “-” switch is used to give all the environmental variables. Using su – without specifying a user will assume you want to switch to the root user. There is a file called /etc/sudoers that holds the configuration for su.

So now we are logged in, lets cover some rudimentary file system-related items. When logged in as a normal user, they would initially be placed in their home directory that was created when the user was created, as was shown before. Move about the system using the command cd, the same as Windows, but remember that Linux is case sensitive.

Using the Linux CLI

With Linux, the backslash becomes a forward slash. To return to your own home directory at any point, just type cd without any arguments. If you are also not sure where you are in the file structure, there is a command called pwd. This command will give the full path to your current location. This is a very useful command, especially if you have many windows open – and double check before using potentially dangerous commands!

Managing Drives with Linux

Linux has no concept of drive letter mappings. Instead drive letters map to what are known as mount points. A very rudimentary example is with CD ROM drives. In Windows, when a CD is inserted, it is mounted as a drive letter. For example, E: This differs in Linux because when you mount a CD, it essentially links the contents of a CD to a folder. Something to bear in mind is that as a rule Linux machines do not auto mount media.

An administrator would have to mount the CD and link it to a folder. Most modern Linux distributions come with a media folder for this purpose. To mount a CD, use the commandmount /dev/cdrom /media. Similarly, to dismount a disk, use the command umount /media. This mounting method is not only for CDs but also for USB sticks, hard disks, and most other media, albeit with some occasional options to specify file systems and such.

To see what is mounted currently, type the command mount. Standard mounts are stored in the file /etc/fstsab. You can modify this file to add additional mount points if you wanted to add additional storage systems at boot. Pro tips: First, make sure you have a backup (use the command cp /etc/fstab fstab.bak). Second, use the mount -a command to verify the fstab file is still valid before you reboot it and find that it isn’t!

Now it might be a good time to introduce you to how most Linux installations are organized from a file and directory perspective.

  • / – root, as in the top level of the disk
  • /home – where users home directories and personal data are located
  • /boot – contains important boot files. You will rarely need to go in here
  • /dev – contains pseudo devices that link directly to the hardware
  • /root – the roots home directory, and where a root can store its files
  • /etc – contains all the configuration files for pretty much everything: networking, services, and some applications
  • /mount – This folder is used to mount NFS mounts and removable media
  • /var – Contains many system components, logs, and miscellaneous
  • /proc – Holds information about running processes.
  • /bin – Contains program files
  • /sbin – Contains system administration binary files

Useful Linux CLI Commands

When working with files, there are some useful commands you can run to help you manage them, as Linux doesn’t tend to do file extensions. If you want to know what type of file you are looking at, you can use the command file file, and it will interrogate the file and provide all the information it can gather.

To view human readable files, you can use the cat command. To edit a file, use the nano editor (for example, nano filename).

If you need to find a file, you can use the locate command. For example, to locate redhat-release (This file holds the release information for the RedHat Build) use the command locate redhat-release.

Other useful commands we can use right now are df, which gives disk space statistics. Usingdf -h may prove a better option as it gives sizes in human readable form of megabytes, gigabytes, and such, rather than an unwieldy size in bytes.

If you want to change your password now, you can use the command passwd. Used without any switches, it will allow you to change the password of the user you are logged in as. If you are logged in as root, you can change other people’s passwords by using the passwdcommand, followed by the username. An example would be passwd stuart.

It is also possible to edit the user setup by use of the command usermod. This will allow you to manage and modify settings on a per-user basis; for example, changing the username or home directory.

via Linux for Windows Server Administrators.

 

 

How to enable Shadow Copy on a shared folder in Windows Server 2012 R2

What Is a Shadow Copy?

shadow copy of a disk volume or shared folder is a snapshot of changes made to files at a given point in time. Snapshots are taken at set intervals, allowing users to restore to a previous version of a file without having to ask IT to restore the file from a backup.

Configure Shadow Copies for a File Share in Windows Server 2012 R2

To configure shadow copies in Windows Server 2012 R2, log on to your file server with a local administrator account and follow the instructions:

  • Switch to the server desktop and open File Explorer by using the icon on the desktop taskbar or by pressing WINDOWS + E.
  • In File Explorer, right-click the volume where the share is located and select Properties from the menu.
  • In the Properties dialog, switch to the Shadow Copies tab.
  • Under Select a volume:, select the volume where you want to turn on shadow copies from the list, and then click Enableshadow1
  • In the Enable Shadow Copies dialog, click Yes to complete the procedure, noting the warning about file servers with high I/O loads.
  • In the Properties dialog, you will see that shadow copies are now enabled for the volume, and when the next snapshot is scheduled to be taken.

Optionally, you can click Create Now to have a snapshot created immediately. There are also options to delete and revert to a previous shadow copy.

  • Now click Settings in the Properties dialog.
  • In the Settings dialog, you can view information about where the shadow copies are located and change the reserved disk space available to the Volume Shadow Service (VSS).
  • The default schedule takes two snapshots daily: Monday to Friday. If you want to change these settings, click Schedule and add or remove scheduled tasks as required.
  • Click OK in the Settings dialog, and again in the Properties dialog to complete the configuration.

Restore Files Using Previous Versions

Windows 7 (and later) clients support restoring from file shares where shadow copies are enabled.

  • From a supported client, or locally from Windows Server, right-click the file you want to revert and select Properties from the menu.
  • In the Properties dialog, switch to the Previous Versions tab.
  • If there is a copy of the file available to restore, it will be displayed in the list, with the time and date of the copy.
  • Select a previous version of your file from the list. shadow2
  • Now you can decide to restore, open, or copy the file as appropriate and follow the instructions.
  • Close the Properties dialog when you’re done.

via How to enable Shadow Copy on a shared folder in Windows Server 2012 R2.

Linux Static IP Address Configuration

You need to update and/or edit the network configuration files.

In this example you will use the following Internet Protocol Version 4 (TCP/IPv4) Properties including IP, default gateway, and preferred DNS servers:

IP address: 192.168.1.10

Netmask: 255.255.255.0

Hostname: server1.cyberciti.biz

Domain name: cyberciti.biz

Gateway IP: 192.168.1.254

DNS Server IP # 1: 192.168.1.254

DNS Server IP # 2: 8.8.8.8

DNS Server IP # 3: 202.54.2.5

           

For static IP configuration you need to edit the following files using a text editor such as vi.

Edit /etc/sysconfig/network as follows, enter:

# cat /etc/sysconfig/network

 

Sample static ip configuration:

NETWORKING=yes

HOSTNAME=server1.cyberciti.biz

GATEWAY=192.168.1.254

 

Edit /etc/sysconfig/network-scripts/ifcfg-eth0, enter:

# cat /etc/sysconfig/network-scripts/ifcfg-eth0

 

Sample static ip configuration:

# Intel Corporation 82573E Gigabit Ethernet Controller (Copper)

DEVICE=eth0

BOOTPROTO=static

DHCPCLASS=

HWADDR=00:30:48:56:A6:2E

IPADDR=192.168.1.10

NETMASK=255.255.255.0

ONBOOT=yes

 

Edit /etc/resolv.conf and setup DNS servers, enter:

# cat /etc/resolv.conf

 

Sample static IP configurations:

search cyberciti.biz

nameserver 192.168.1.254

nameserver 8.8.8.8

nameserver 202.54.2.5

 

Finally, you need to restart the networking service, enter:

# /etc/init.d/network restart

 

To verify new static ip configuration for eth0, enter:

# ifconfig eth0

# route -n

# ping 192.168.1.254

# ping google.com

 via Linux Static IP Address Configuration.

 

How to back up and restore the registry in Windows

Back up the registry

Windows 8.1 and Windows 8

Swipe in from the right edge of the screen, and then tap Search. Or, point to the upper-right corner of the screen, and then click Search.

In the search box, type regedit.exe, and then press Enter. If you are prompted for an administrator password or confirmation, type the password or provide confirmation.

In Registry Editor, locate and click the registry key or subkey that you want to back up.

Click File > Export.

In the Export Registry File dialog box, select the location where you want to save the backup copy to, and then type a name for the backup file in the File name field.

Click Save.

Windows 7 and Windows Vista

Click Start, type regedit.exe in the search box, and then press Enter. If you’re prompted for an administrator password or confirmation, type the password or provide confirmation.

In Registry Editor, locate and click the registry key or subkey that you want to back up.

Click File > Export.

In the Export Registry File dialog box, select the location where you want to save the backup copy to, and then type a name for the backup file in the File name field.

Click Save.

Windows XP

Follow these steps to create a system restore point:

Click Start, click Run, type %SystemRoot%\system32\restore\rstrui.exe, and then click OK.

On the Welcome to System Restore page, click Create a restore point, and then click Next.

On the Create a Restore Point page, type a name for the restore point and then click Create.

After the restore point is created, click Close.

Note If System Restore is turned off, you receive a message that asks whether you want to turn on System Restore now. Click Yes. Then, in the System Properties dialog box, click to clear the Turn off System Restore check box, click OK, and then repeat this step. For more information, see How to turn off and turn on System Restore in Windows XP.

Restore the registry

Windows 8.1 and Windows 8

Swipe in from the right edge of the screen, and then tap Search. Or, point to the upper-right corner of the screen, and then click Search.

In the search box, type regedit.exe, and then press Enter. If you are prompted for an administrator password or confirmation, type the password or provide confirmation.

In Registry Editor, click File > Import.

In the Import Registry File dialog box, select the location where you saved the backup copy to, click to select the backup file, and then click Open.

Windows 7 and Windows Vista

Click Start, type regedit.exe in the search box, and then press Enter. If you’re prompted for an administrator password or confirmation, type the password or provide confirmation.

In Registry Editor, click File > Import.

In the Import Registry File box, select the location where you saved the backup copy to, click to select the backup file, and then click Open.

Windows XP

Use System Restore to undo registry changes in Windows XP:

Click Start, click Run, type %SystemRoot%\System32\Restore\Rstrui.exe, and then click OK.

On the Welcome to System Restore page, click Restore my computer to an earlier time (if it is not already selected), and then click Next.

On the Select a Restore Point page, click the system checkpoint. In the On this list select the restore point area, click an entry that is named “Guided Help (Registry Backup),” and then click Next. If a System Restore message appears that lists configuration changes that System Restore will make, click OK.

On the Confirm Restore Point Selection page, click Next. System Restore restores the previous Windows XP configuration and then restarts the computer.

Log on to the computer. When the System Restore confirmation page appears, click OK.

via How to back up and restore the registry in Windows.

How to fix SSL MITM vulnerability on F5 BIG-IP LTM 9.4.7

  1. You can test your SSL Server vulnerability on https://www.ssllabs.com/ssltest/index.html.

This free online service performs a deep analysis of the configuration of any SSL web server on the public Internet.

2. Test results for x.x.com can show that it is vulnerable to MITM attacks because it supports insecure renegotiation, effectively allowing an active man-in-the-middle attacker to inject arbitrary content into an encrypted data stream.

This is called also – “plaintext injection” attack or “Project Mogul” issue. A Man in the Middle attack allows an attacker to inject an arbitrary amount of chosen plain text into the application protocol stream data during a secure session renegotiation that uses SSL version 3.x or TLS version 1.x. This may provide an attacker the ability to perform arbitrary actions on affected websites with user’s credentials. This vulnerability does not allow one to decrypt the intercepted network communication. MITM1

3. You can test which F5 Product and version is affected with SSL Renegotiation vulnerability.

http://support.f5.com/kb/en-us/solutions/public/10000/700/sol10737.html.

In my case BIG-IP LTM 9.4.7 is affected. MITM2

The IETF has adopted as RFC5746: Transport Layer Security (TLS) Renegotiation Indication Extension a new extension to the TLS standard that addresses this issue. F5 Product Development has implemented this new extension beginning in BIG-IP versions 10.2.3 and 11.0.0.

For BIG-IP versions 9.4.x, 9.3.x prior to 9.3.1 HF8, and 10.0.x prior to 10.0.1 HF3:

  1. Take care though to check that your virtual server does _not_ depend on (benign) renegotiations. If you’re not sure, you can use:

bigpipe profile clientssl all show all | grep -e PROFILE -e mid-stream

  1. Apply an iRule similar to the following to each SSL virtual server. The iRule resets the connection if client-side SSL renegotiation is attempted.

 

when CLIENT_ACCEPTED {
# initialize TLS/SSL handshake count for this connection
set sslhandshakecount 0
}
when CLIENTSSL_HANDSHAKE priority 1 {
# a handshake just occurred
incr sslhandshakecount
# is this the first handshake in this connection?
if { $sslhandshakecount > 1 } {
# log (rate limited) the event (to /var/log/ltm)
log “\[VS [IP::local_addr]:[TCP::local_port] client [IP::remote_addr]:[TCP::remote_port]\]:TLS/SSL renegotiation”
# if not, close the clientside connection
reject
}
}

Links:

SSL Test site

SSL and TLS Authentication Gap vulnerability Explanation 1

SSL and TLS Authentication Gap vulnerability Explanation 2

F5 products and versions that have been evaluated for this Security Advisory

How to View the Available Storage Space on iPhone 5

How to View the Available Storage Space on the iPhone 5 – Solve Your Tech.

Step 1: Tap the Settings icon.

Step 2: Touch the General button.

Step 3: Select the Usage option.

Step 4: Look at the numbers at the top of the screen under Storage to see how much space you have left, and how much space you have used.

You can also scroll down to see what apps are using the most storage, as well as how much iCloud storage you are using from your account.

 

 

Install Active Directory Management Service for Easy PowerShell Access.

Install Active Directory Management Service for Easy PowerShell Access – Hey, Scripting Guy! Blog – Site Home – TechNet Blogs.

You can control AD from remote PC or Server:

1.       Install .NET Framework 3.5 with Service Pack 1 on the domain controller.

2.       on the domain controller Download and install Active Directory Management Gateway Service Windows6.0-KB968934-x86.msu or Windows6.0-KB968934-x64.msu

3.       if you get this error “the update does not apply to your system”:

a.       There are two hotfixes that are required (and there are three options available—a .NET Framework update and an operating system–specific update):

                                                               i.      KB967574 hotfix which is already installed if the DC is running server 2008 SP 2.

                                                             ii.      969166 hotfix which is a .NET Framework 3.5 SP1 hotfix rollup – no need to reboot the DC after the installation.

                                                            iii.      For Windows Server 2003 and Windows Server 2003 R2, there is a specific hotfix that is described in KB 969429 – no need to install for 2008 DC.

                                        iv.    The third hotfix that is listed applies to Windows Server 2008. This hotfix, KB 967574, applies if you have not installed Service Pack 2 on the system.

4.     After the two updates are applied to the system and the Active Directory Management Gateway Service is installed, a reboot of the server is required.

5.     On the DC open the services.msc utility and verify that Active Directory Web Services service is created and running.

6.     Connect to the DC with Windows PowerShell from your Windows 7 desktop.

7.     Download and install the active directory powershell module on your Windows 7 desktop.

8.     Import the Active Directory module.

 

9.     end

Raise the Forest Functional Level

Raise the Forest Functional Level.

To raise the forest functional level

  1. Open Active Directory Domains and Trusts. To open Active Directory Domains and Trusts, click Start , click Administrative Tools , and then click Active Directory Domains and Trusts .

  2. In the console tree, right-click Active Directory Domains and Trusts , and then click Raise Forest Functional Level .

  3. In Select an available forest functional level , select the value and then click Raise .

  4. Do not raise the forest functional level higher if you have or will have any domain controllers running an earlier version of Windows Server.

Raise the Domain Functional Level

Raise the Domain Functional Level.

To raise the domain functional level

  1. Open Active Directory Domains and Trusts. To open Active Directory Domains and Trusts, click Start , click Administrative Tools , and then click Active Directory Domains and Trusts .

  2. In the console tree, right-click the domain for which you want to raise functional level, and then click Raise Domain Functional Level .

  3. In Select an available domain functional level , select the value and then click Raise .

  4. Do not raise the domain functional level to a higher value if you have or will have any domain controllers running earlier versions of Windows Server.