What is sid in linux

Setting up a default ORACLE_SID in linux

Every time I log in to oracle, I am given an error:

ORA-12162 TNS:net service name is incorrectly specified

So I am forced to run this:

I’d like to set mydb to be the default ORACLE_SID . I have searched for ways to do this, but I’m too rusty on linux to pull this off. Here’s what I’ve tried so far:

Here’s what my tnsnames.ora looks like:

2 Answers 2

I had to define the ORACLE_SID and export it in the oracle user’s .bash_profile . This means these two steps are run each time the oracle user logs in, so it’s possibly more of a hack, but it works:

Here’s the short version. If you’re not sure what you’re doing, go to the detailed section where I explain what’s going on.

esc , :w! to save, :q to quit.

Details

Defining the shell (Optional)

If you’re like me, and the sys admins set up the oracle account to automatically disable the shell on logout, you’ll need to first redefine the shell for the oracle user (as root):

Edit the profile Then you need to login as the oracle user and edit .bash_profile :

You’re now editing the .bash_profile in the VI editor. It should look something like this:

What you need to do is add your SID stuff after export PATH , so it should look like this:

OK, now you gotta save the file, and exit vi:

esc , :w! to save, :q to quit.

Troubleshooting Sidebar: If you have an issue saving the file because the oracle user doesn’t have privileges, then you’ll have to do it using the root user, which means you’ll have to find oracle’s .bash_profile file, which is probably in /home/oracle/ (Remember, it’s a hidden file, so use ls -a to see it instead of ls )

OK, so assuming you’re still logged in as the oracle user, you need to logout and log back in. That will activate the code you just added, and define the ORACLE_SID.

Источник

What do the identifiers PID, PPID, SID, PGID, UID, EUID mean?

I was assigned to

Write a C program that prints the following identifiers PID, PPID, SID, PGID, UID, EUID.

The assignment then went on to ask

What represents each identifier?

I have completed the program, but have not found adequate explanations for the identifiers.

  • What do they really represent?
  • Especially what is the purpose of the SID and PGID identifiers?

1 Answer 1

They’re as follows

  • PID — Process ID
  • PPID — Parent Process ID
  • SID — Session ID
  • PGID — Process Group ID
  • UID — User ID
  • EUID — Effective User ID

Take a look at this SO Post and the first answer for a healthy explanation of what they’re for.

3.270 Parent Process ID

An attribute of a new process identifying the parent of the process. The parent process ID of a process is the process ID of its creator, for the lifetime of the creator. After the creator’s lifetime has ended, the parent process ID is the process ID of an implementation-defined system process.

3.343 Session

A collection of process groups established for job control purposes. Each process group is a member of a session. A process is considered to be a member of the session of which its process group is a member. A newly created process joins the session of its creator. A process can alter its session membership; see setsid(). There can be multiple process groups in the same session.

3.296 Process Group

A collection of processes that permits the signaling of related processes. Each process in the system is a member of a process group that is identified by a process group ID. A newly created process joins the process group of its creator.

3.297 Process Group ID

The unique positive integer identifier representing a process group during its lifetime.

3.142 Effective User ID

An attribute of a process that is used in determining various permissions, including file access permissions; see also User ID.

† Note that the EUID and EGID (Effect Group ID) are not used for filesystem permissions under Linux which takes filesystem’s FSUID and FSGID fields respectively instead.

Читайте также:  Windows 10 brightness settings

Источник

What is the definition of a «session» in linux?

When I run the «w» command, I see two users logged in (both are me). A quick search here tells that this is normal because «A single user can have multiple active sessions at any one time.»

What is a session? Why do I have two of them when I’ve only logged into my system once?

5 Answers 5

Session usually refers to shell sessions. A shell is what allows you to interact with the computer. It acts as a bridge between the user and the kernel. Whenever you run a command, it is the shell that captures your intent and tells the kernel to do its thing.

In most Linux flavors, the default shell is bash and a new bash session will be launched every time you open a new terminal. In the output of w you posted, you seem to have your graphical login session (looks like you’re sshing o the machine):

A few open terminal emulators:

And you also seem to have logged in from a non-graphical tty:

Each of these is a separate instance of your shell and each counts as its own session.

1. Although user login into single process(shell which is their command line interface), users ends up running many process as result of action like:

-> Running non-interactive task in background.
-> Switching among interactive task via job control.
-> Starting multiple process that work together through pipes.
-> Running windowing system such as X window system which allow multiple terminal windows to opened.

2. In order to handle all these processes, kernel need to form process groups comprise of these processes.

3. To mange these process groups further according to user, these groups are divided according to user into sessions.(Note here user is not linux user, but shell or terminal stands for user. Two terminals on same machine logged in by same linux user stands for 2 different user and thus 2 different user session here. A terminal can be controlling terminal for only single session).
The process that is running shell for that “user” or session is known as session leader.

4. Also note closing terminal by pressing ‘x’ button not make you out of that terminal. That terminal keeps running in background. If you want to over session from terminal, you have to logout from there by pressing CTRL+D or exit.

5. As you logout from terminal, kernel sends SIGHUP signal(similar to kill -1) to process that is session leader. Now every other process that is running in terminal is child of this session leader. These child processes had formed process groups that are controlled by this session leader process(parent process).

6. Session leader process send SIGHUP to each child process, some process terminate, while some can choose not to terminate(those suspended or running in background). Those choose not to terminate become orphaned as session overs and immediately adopted by init process(parent of all process in linux machine).

Источник

What is sid in linux

Добрый день! Уважаемые читатели и гости IT блога Pyatilistnik.org. В прошлый раз мы с вами установили домен Active Directory на Windows Server 2019. Одним из краеугольных понятий в AD является идентификатор безопасности компьютера SID, о нем и пойдет речь. Мы разберем, какие они бывают у сервера и рабочей станции, а так же научимся определять SID компьютера, буквально за минуту.

Сколько у компьютера SID-ов?

О том, что такое SID у пользователя, я уже рассказывал. SID — это уникальное имя (буквенно-цифровая символьная строка), которое используется для идентификации объекта, такого как пользователь или компьютер в сети систем NT. Windows предоставляет или запрещает доступ и права доступа к ресурсам на основе ACL, которые используют SID для уникальной идентификации компьютеров и их членства в группах. Когда компьютер запрашивает доступ к ресурсу, его ACL проверяет SID компьютера, чтобы определить, разрешено ли этому компьютеру выполнять это действие или нет. Схематично выглядит вот так.

Читайте также:  Греческий алфавит для windows

Существует два типа SID у компьютера:

  • Первый тип, это когда рабочая станция или сервер не являются членом домена Active Directory
  • Второй тип, это когда компьютер входит в домен Active Directory

В обоих случаях у вас будет два абсолютно разных SID. Первый дескриптор безопасности у вас генерируется при установке системы, второй если вы вводите его в домен AD. И так, у меня есть тестовый домен root.pyatilistnik.org. Есть клиентская станция с Windows 10 1803. Для того, чтобы вам показать разницу и оба SID идентификатора на моей тестовой Windows 10, мы воспользуемся утилитой Марка Русиновича PsGetSid из инструментария Sysinternals (Скачать PsGetSid можно по ссылке https://docs.microsoft.com/en-us/sysinternals/downloads/psgetsid). Распаковываете архив с утилитой, открываете командную строку от имени администратора и переходите с помощью cd в каталог с утилитой PsGetSid.

Первым делом я выведу имя компьютера, через команду hostname. В моем примере, это W10-CL01.

Далее я выведу локальный SID компьютера, через утилиту PsGetSid:

В итоге я получил SID for W10-CL01\w10-cl01:S-1-5-21-7706586-876249769-275126362. Обратите внимание, что перед идентификатором безопасности идет имя компьютера, это сразу говорит, что он локальный.

И команда указанная выше, показывает вам доменный SID рабочей станции. SID for ROOT\w10-cl01$:S-1-5-21-233550040-578987154-4094747311-1602. Обратите внимание, что перед идентификаторам идет имя домена ROOT\.

Нюансы идентификаторов безопасности на рабочих станциях

Некоторое время назад, Марк Руссинович, очень известный человек в мире Microsoft, написал замечательную статью, про мифы дублирования SID, где показал на практике свои мысли, но после прочтения статьи у некоторых людей оставалась в голове путаница или вопросы, \ бы хотел немного уточнить по статье (Ссылка на нее https://blogs.technet.microsoft.com/mark_russinovich/2009/11/15/sid/).

Предположим, что вы клонируете нужную вам виртуальную машину или хост. Если вы не обезличиваете систему, с помощью Sysprep, то у вас все полученные клоны систем, будут иметь один локальный SID компьютера. Если мы говорим про окружение в виде рабочей группы в локальной сети, то ни каких проблем с доступом или конфликтом с доступом к ресурсам вы не увидите. Но вот в случае с доменным SID, такое не получится, он должен быть уникальным в пределах Active Directory, в противном случае, у вас будут конфликты между двумя объектами. Убедитесь, что после клонирования и обезличивания у вас разные SID, полученные от мастера RID.

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

Методы определения сида компьютера

  • Первый метод я вам уже показал. он заключается в использовании утилиты PsGetSid
  • Второй метод, это использование командной строки, с помощью утилиты dsquery. Получать мы таким методом будем доменный SID у сервера или рабочей станции:

dsquery computer — name «Имя компьютер» | dsget computer — SID

Хочу отметить, что данную команду вы должны выполнять либо на контроллере домена или же на рабочей станции, где установлены консоли администрирования и утилиты из пакета RSAT.

  • Через скриптик VBS. Вы копируете код представленный ниже или скачиваете уже готовый файл у меня, только лишь потом отредактировав его и изменив имя на свое. После чего у вас будет запрошен локальный SID компьютера. Напоминаю, что у всех встроенных групп или учетных записей, начало их идентификатора безопасности состоит из полного SID компьютера с добавлением своего дополнительного номера.

  • Куда же без PowerShell в нем можно делать, что угодно. Вот пример кода дающего локальный идентификатор безопасности у рабочей станции:

тут так же будет запрошен SID учетной записи «Администратор». Если компьютер доменный, то нам поможет командлет Get-ADComputer. Запускаем оснастку PowerShell и вводим команду:

Get-ADComputer W10-CL01 -prop sid

Как видите методов очень много. Видел я метод и получения сида из реестра Windows, в ветке

Источник

What Is an SID Number?

Every Windows user has a unique security identifier

Tim Fisher has more than 30 years’ of professional technology experience. He’s been writing about tech for more than two decades and serves as the VP and General Manager of Lifewire.

Читайте также:  Очистка файловой системы windows

A SID, short for security identifier, is a number used to identify user, group, and computer accounts in Windows.

They’re created when the account is first made in Windows and no two SIDs on a computer are ever the same.

The term security ID is sometimes used in place of SID or security identifier.

Why Does Windows Use SIDs?

Users (you and me) refer to accounts by the account’s name, like «Tim» or «Dad», but Windows uses the SID when dealing with accounts internally.

If Windows referred to a common name like we do, instead of a SID, then everything associated with that name would become void or inaccessible if the name were changed in any way.

So instead of making it impossible to change the name of your account, the user account is instead tied to an unchangeable string (the SID), which allows the username to change without affecting any of the user’s settings.

While a username can be changed as many times you like, you’re unable to change the SID that’s associated with an account without having to manually update all the security settings that were associated with that user to rebuild its identity.

Decoding SID Numbers in Windows

All SIDs start with S-1-5-21 but will otherwise be unique. If you need to, you can find a user’s security identifier (SID) in Windows for matching users with their SIDs.

A few SIDs can be decoded without the instructions linked above. For example, the SID for the Administrator account in Windows always ends in 500. The SID for the Guest account always ends in 501.

You’ll also find SIDs on every installation of Windows which correspond to certain built-in accounts. For example, the S-1-5-18 SID can be found in any copy of Windows you come across and corresponds to the LocalSystem account, the system account that’s loaded in Windows before a user logs on.

Here’s an example of a user SID:

Yours will be different, but the purpose of each part of the SID remains the same:

S 1 5 21-1180699209-877415012-3182924384 1004
Indicates that this is a SID SID specification version number Identifier authority Domain or local computer identifier Relative ID

Any group or user that was manually created (i.e., not included in Windows by default) will have a Relative ID of 1000 or greater.

The following are a few examples of the string values for groups and special users that are universal across all Windows installs:

  • S-1-0-0 (Null SID): Assigned when the SID value is unknown, or for a group without any members.
  • S-1-1-0 (World): This is a group of every user.
  • S-1-2-0 (Local): This SID is assigned to users who log on to a local terminal.

More on SID Numbers

While most discussions about SIDs occurs in the context of advanced security, most mentions on our site revolve around the Windows Registry and how user configuration data is stored in certain registry keys that are named the same as a user’s SID. So, in that respect, the above summary is probably all you need to know about SIDs.

However, if you’re more than casually interested in security identifiers, Microsoft has a full explanation of SIDs. You’ll find information about what the various sections of the SID actually mean and you can see a list of well-known security identifiers like the S-1-5-18 SID we mentioned above.

SID Used in Other Terms

SID is also an acronym for other technology terms but none of them are related to an SID as it’s explained above. Some examples include session identifier, serial interface device, standard integrated desktop, Safer Internet Day, and subscriber identification.

The .SID letter group is also used in some file extensions. For example, ScanIt Documents, SID Audio, MrSID Image, and Steam Game Data Backup files all use the SID suffix to indicate their relative file formats.

You can find a user’s SID using the Windows Management Instrumentation Command. In Command Prompt, type wmic useraccount where name=»USER» get sid replacing USER with the username > Enter.

Источник

Оцените статью