Как подключить сетевой каталог Windows в консоли Linux

Март 10, 2009 Sharm 8 comments

Современные дистрибутивы Linux позволяют подключать сетевые диски компьютеров под управлением Windows через графический интерфейс. Но иногда удобнее выполнить команду в консоли.

Для Fedora это будет:

mount -t cifs //server/sharedfolder /mnt -odomain=LOCALDOMAIN,user=username

В некоторых других системах вместо «cifs» нужно указать «smbfs»:

mount -t smbfs //server/sharedfolder /mnt -odomain=LOCALDOMAIN,user=username

Эта команда подключит сетевой каталог sharedfolder на сервере server (\\server\sharedfolder) по адресу /mnt.

Выполнив затем команду «ls /mnt», вы должны увидеть содержимое сетевого каталога.

Для того, чтобы закрыть подключение, достаточно выполнить

umount /mnt

Команды mount и umount должны выполняться под пользователем root.

Рубрики:Unix and Linux

NTFS Links

NTFS links – reparse, symbolic, hard, junction

http://waynes-world-it.blogspot.com/2008/06/ntfs-links-reparse-symbolic-hard.html

Reading through various Microsoft documents, it seems several terms have been adopted to describe methods of linking one NTFS object to another in different scenarios. I tried and couldn’t find a single description of the different methods; therefore below you’ll find my interpretation, mostly describing how they link to each other, and the tools available to manage the links.

Reparse Point File – user-defined data, interpreted by a file sytem filter, eg. RIS SIS, Microsoft RSS
Reparse Point Directory – Map a local folder to any other local folder on or across local volumes, eg c:\windows\temp mapped to c:\temp
Hard Link File – filesystem link linking one file to another, linking a file object to one or more directory entries.
NTFS Junction Point Directory -> Reparse Point Directory
Directory Symbolic Link -> NTFS Junction Point Directory
Volume Mount point -> Directory Symbolic Link mapping the root of one local volume to a folder in another local volume
Soft Link Directory -> NTFS Junction Point Directory -> Reparse Point Directory
NTFS Junction Point Files -> Reparse Point File
Symbolic Directory Links -> NTFS Junction Point Directory
Symbolic File Links Matching Unix symbolic link (soft link) functionality with absolute file, relative file in local -> local, local -> remote, remote -> local and remote -> remote combinations, available in Vista and 2008.
Tools to manage links:

linkd.exe (2000 resource kit) – Create NTFS Junction Points (the source directory must be empty)
mountvol.exe (2000 CD-rom) – Manage directory symbolic links deisnged to mount a volume (which may or may not have a drive letter already associated) bypassing 26 drive letter limitations
delrp.exe (2000 resource kit) – Delete NTFS junction points and other types of reparse points
junction.exe (sysinternals) – Create or delete NTFS Junction points (reparse points). Note that you can create a junction that maps a directory to a file target, it just doesn’t achieve much.
fsutil.exe hardlink (oem with XP/2003) – Create hard file links
fsutil.exe reparsepoint (oem with XP/2003) – Query or delete reparse points
mklink – Vista/2008 utility to create symbolic directory and file links, hard links and directory junctions
Читать дальше…

Рубрики:Microsoft Метки: ,

Хорошие статьи о SVN

Нашел сайт с хорошими статьями по SVN: http://nordisch.org/svn

Например, предыдущая статья взята оттуда. Обнаружил в процессе поисков решения проблемы, что файл db/current постоянно сбрасывал владельца, после чего доступ пользователей, входящих в группу SVN, блокировался.

Рубрики:Subversion Метки:

SVN and permissions

Quite often I hear people complaining “BDB sucks, it breaks here twice a day! I will use FSFS now. BDBjust sucks”. This seems true at first. But in many cases, it’s an administration error.  :)

As the svn book and FAQ point out in many places, you need to take care of the permissions. The first important link with BDB and permissions might be the FAQ entry “Why do read-only operations still need repository write access?”. It explains why BDB requires write permission to the repository directory even for readonly operations. At this point, FSFS seems distinctly better than BDB, because FSFS only requires read permissions for readonly operations.

 For our checklist we keep in mind that a user needs write permissions for reading the repos.

Now we have to sort out the question “Who needs access to our repos?” I will discuss some common setups here.

Читать дальше…

Рубрики:Subversion

Как подружить Vista и Samba

Установив Microsoft Vista обнаружил, что с компьютера невозможно получить доступ к сетевым ресурсам на сервере Samba под Linux. Быстрый поиск показал, что причиной является отсутствие поддержки NTLMv2 на нашем Samba сервере. В Microsoft Vista по умолчанию отключены более старые протоколы аутентификации. 

Исправить эту ситуацию можно так:

1. Открыть окно «Run» для выполнения команд и запустить «secpol.msc»:

Vista and Samba

2. Выбрать «continue» когда Vista выведет предупреждение

3. Выбрать «Local Policies» –> «Security Options»:

Vista and Samba

4. Найти «Network Security: LAN Manager authentication level» и открыть. 

5. Изменить значение по-умолчанию «NTVLM2 responses only» на «LM and NTLM – use NTLMV2 session security if negotiated»:

Vista and Samba

Теперь Vista сможет работать с Samba нормально. Однако лучшим вариантом, пожалуй, является обновление Samba до 3-ей версии, где уже реализована поддержка NTVLM2. 

Нас ведь интересует безопасная работа :)

Original

Как настроить SVN+SSH

Сентябрь 25, 2008 Sharm 2 comments

0 Introduction
This Guide will explain in easy steps how to setup your Linux server
working for Subversion repository access through SSH client access.

The svn+ssh:// protocol enables you to use SSH client access is throught
the password prompt or using public private keys validation.
No Public/private key generation is necessary to use the simplified
svn+ssh protocol, but it might be a good idea, so that you can avoid
password prompts all the time when using the SVN client access.

This guide assumes that you know how to setup SSH with public/private
keys on the server and on your client, and that you already have
installed Subversion on your Linux box.

Читать дальше…

Рубрики:HOW-TO, Subversion, Unix and Linux Метки: , ,

Как добавить пользователей в группу в Linux

Сентябрь 25, 2008 Sharm 5 comments

Чтобы добавить пользователя в группу можно использовать команды useradd или usermod. Useradd создаст нового пользователя. Usermod модифицирует существующую запись, ее можно использовать для добавления существующего пользователя в группу.

Есть два типа групп – первичная и вторичная. Вся информация о пользователях сохраняется в файлах /etc/passwd,/etc/shadow и /etc/group.

Useradd – добавить нового пользователя во вторичную группу

Use useradd command to add new users to existing group (or create a new group and then add user). If group does not exist, create it. Syntax:

useradd -G {group-nameusername
Create a new user called vivek and add it to group called developers. First login as a root user (make sure group developers exists), enter:
# grep developers /etc/group
Output:

developers:x:1124:

If you do not see any output then you need to add group developers using groupadd command:
# groupadd developers
Next, add a user called vivek to group developers:
# useradd -G developers vivek
Setup password for user vivek:
# passwd vivek
Ensure that user added properly to group developers:
# id vivekOutput:

uid=1122(vivek) gid=1125(vivek) groups=1125(vivek),1124(developers)

Please note that capital G (-G) option add user to a list of supplementary groups. Each group is separated from the next by a comma, with no intervening whitespace. For example, add user jerry to groups admins, ftp, www, and developers, enter:
# useradd -G admins,ftp,www,developers jerry

Useradd – добавить нового пользователя в первичную группу

To add a user tony to group developers use following command:
# useradd -g developers tony
# id tony

uid=1123(tony) gid=1124(developers) groups=1124(developers)
Please note that small -g option add user to initial login group (primary group). The group name must exist. A group number must refer to an already existing group.

Usermod – добавить существующего пользователя в существующую группу

Add existing user tony to ftp supplementary/secondary group with usermod command using -a option ~ i.e. add the user to the supplemental group(s). Use only with -G option :
# usermod -a -G ftp tony

Change existing user tony primary group to www:
# usermod -g www tony

Рубрики:HOW-TO, Unix and Linux Метки: , ,

Как увеличить размер диска в виртуальной машине VMWARE

Август 7, 2008 Sharm 2 comments

vmware-vdiskmanager.exe -x 20Gb «C:\Virtual Machines\Windows XP\Windows XP Professional.vmdk»

Рубрики:HOW-TO, VMWARE Метки: ,

Как сделать, чтобы в CentOS под VMWARE время не убегало

Ситуация следующая:

под VMWARE Server, запущенном на Intel Core2 Quad Q6600 с Windows XP Professional x64, работают несколько виртуальных машин.

В качестве Linux системы используется CentOS 5. И под этими системами время очень сильно отстает от реальной жизни. Настройка ntpd в такой ситуации не помогает.

В принципе, можно регулярно запускать ntpdate для коррекции времени. Но в моем случае время за 10 секунд отстает на 5 секунд. Не ежесекундно же синхронизироваться :)

Нашел описание ситуации от VMWARE.

Сначала дописал в /boot/grub/grub.conf в конце строки с kernel:

clock=pit nosmp noapic nolapic

По описанию это должно решить проблему как с отставанием, так и со спешкой. Время стало спешить за 1 минуту на 10 секунд. Дело в том, что у меня не установлены VMWARE Tools. Поэтому я воспользовался альтернативным вариантом:

clock=pmtmr nosmp noapic nolapic

Первый вариант отключал коррекцию пропущенных тактов ядром, второй включает улучшенный механизм коррекции.

После последней перезагрузки время практически не уходит. Теперь со спокойной душой запустил ntpd и все пошло как по маслу!

Рубрики:HOW-TO, Unix and Linux, VMWARE Метки: , ,

Советы по обслуживанию серверов баз данных от Paul S. Randal

Several times a week I’m asked for advice on how to effectively maintain a production database. Sometimes the questions come from DBAs who are implementing new solutions and want help
fine-tuning maintenance practices to fit their new databases’ characteristics. More frequently, however, the questions come from people who are not professional DBAs but for one reason or another have been given ownership of and responsibility for a database. I like to call this role the «involuntary DBA.» The focus of this article is to provide a primer of database maintenance best-practices for all the involuntary DBAs out there.
As with the majority of tasks and procedures in the IT world, there isn’t an easy one-size-fits-all solution for effective database maintenance, but there are some key areas that nearly always need to be addressed. My top five areas of concern are (in no particular order of importance):
  • Data and log file management
  • Index fragmentation
  • Statistics
  • Corruption detection
  • Backups
An unmaintained (or poorly maintained) database can develop problems in one or more of these areas, which can eventually lead to poor application performance or even downtime and data loss.
In this article, I’ll explain why these issues matter and show you some simple ways to mitigate the problems. I will base my explanations on SQL Server­® 2005, but I’ll also highlight the major differences that you’ll find in SQL Server 2000 and the upcoming SQL Server 2008.

Читать дальше…

Рубрики:Database, HOW-TO, MS SQL Метки: ,