os : Linux version 4.15.0-38-generic (buildd@lcy01-amd64-023) (gcc version 7.3.0 (Ubuntu 7.3.0-16ubuntu3))

ユーザーの入力待受状態になっている自作プログラムに対して、違うpts番号を持つ別の仮想端末からgdbでアタッチしようとしているのですが失敗します。
プログラムはgcc -gオプション付きでコンパイルしました。
gdb -p (pid)でアタッチしようとしています。

以下がメッセージとしてgdb起動時に出力されます。
Attaching to process 16458
Could not attach to process. If your uid matches the uid of the target
process, check the setting of /proc/sys/kernel/yama/ptrace_scope, or try
again as the root user. For more details, see /etc/sysctl.d/10-ptrace.conf
ptrace: 許可されていない操作です.

質問の内容としましては、以上の状況で、
1.アタッチできない理由
2.どうすればアタッチできるようになるのか
が知りたいです。

ご教示お願い致します。