最新記事

X転送GNOME端末インスタンスでGUIアプリケーションを実行するにはどうすればよいですか?
ssh
xforwarding

X転送GNOME端末インスタンスでGUIアプリケーションを実行するにはどうすればよいですか?

私は通常Xに渡されるGNOMEターミナルセッションで作業します。 local-machine$ ssh -X remote-machine gnome-terminal ローカル端末でSSHを実行する代わりに、これを行います。これは、新しいタブがリモートホストの同じディレクトリで開かれるためです(関連する未解決の問題)。 このX転送端末でGUIプログラムを起動しようとすると失敗することがわかりました。 remote-machine$ gedit (gedit:49577): Gtk-WARNING **: 14:32:45.928: cannot open display: localhost:13.0 ただし、別のXフォワードシェルセッションも実行してそのままにする場合: local-machine$ ssh -X remote-machine geditその後、X転送GNOMEターミナルインスタンスと同様にGUIアプリケーションを実行できます。 このソリューションが機能するのはなぜですか?これを行うより簡単な方法はありますか(たとえば、コマンドに追加できるフラグssh -X remote-machine gnome-terminal)。

Admin

SSHセッションに入るときは、キーボードショートカットを使用してパスワードを入力してください。
centos
ssh
keyboard-shortcuts

SSHセッションに入るときは、キーボードショートカットを使用してパスワードを入力してください。

私はCentOSを使用しており、仕事の一部として毎日複数のSSHセッション(サーバー)にログインする必要があり、そのためには毎回パスワードを入力する必要があります。特定のキー(たとえば)を押してパスワードを入力するプロセスを自動化する方法があるかどうか疑問に思いますF12。 ファイルを使ってキーバインドを試みましたが、うまくbashrcいかないようです。

Admin

bashスクリプトのssh EOF - コマンド値を保存する方法は?
linux
bash
shell
ssh
scripting

bashスクリプトのssh EOF - コマンド値を保存する方法は?

デフォルトでは、SSHセッションの複数のフォルダディレクトリに最後に作成されたフォルダをコピーするだけです。これを行うための正しいfindコマンドがありますが、結果をSSHセッションに保存できないようです。変数LATEST_FOLDERが空で、次のことを試しました。 cp -f arkOutput/$(find . -type d -exec stat --printf="%Y\t%n\n" {} \; | sort -n -r | head -1 | cut -f2 | cut -c 3-)/* /synology/data/${OUTPUT_PATH}/${i}/ark 完全なSSHセッションコードは次のとおりです。 ssh [email protected] << EOF cd /data/dev/${ARK_PATH}/ ./gradlew bootRun --no-daemon; LATEST_FOLDER=$(find . -type d -exec stat --printf="%Y\t%n\n" {} \; | sort -n -r | head -1 | cut -f2 | cut -c 3-); cp -f arkOutput/${LATEST_FOLDER}/* /synology/data/${OUTPUT_PATH}/${i}/ark EOF /data/devディレクトリは私がログインしているサーバーにのみ存在するため、事前にインポートして渡すことはできません。 ./gradlew bootRunコマンドは私が興味のあるフォルダを作成します。

Admin

SeatNを強制表示:N
ssh
arch-linux
x11
lightdm
multiseat

SeatNを強制表示:N

3つのGPUを使用したマルチシート設定があり、loginctlほとんどがlightdmうまく機能します。欠落している2つの小さな領域があります。ssh電源が入らない、:0または最後にログインしたときとは異なる番号がある場合、BluetoothオーディオデバイスとのX転送が誤動作することです。 ❯ ps axo pid,user,args | grep xorg 6279 root /usr/lib/Xorg :1 -seat seat0 -auth /run/lightdm/root/:1 -nolisten tcp vt7 -novtswitch 6284 root /usr/lib/Xorg :0 -seat seat2 -auth /run/lightdm/root/:0 -nolisten tcp 6285 root /usr/lib/Xorg :2 -seat seat1 -auth /run/lightdm/root/:2 -nolisten tcp ...変える... ❯ ps axo pid,user,args | grep xorg 6279 root /usr/lib/Xorg :0 -seat seat0 -auth /run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch 6284 root /usr/lib/Xorg :1 -seat seat2 -auth /run/lightdm/root/:1 -nolisten tcp 6285 root /usr/lib/Xorg :2 -seat seat1 -auth /run/lightdm/root/:2 -nolisten tcp 置く... # Force seatN to run on display :N [Seat:seat0] xserver-command=/usr/lib/Xorg :0 -seat seat0 -auth /run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch # [Seat:seat1] xserver-command=/usr/lib/Xorg :1 -seat seat1 -auth /run/lightdm/root/:1 -nolisten tcp # [Seat:seat2] xserver-command=/usr/lib/Xorg :2 -seat seat2 -auth /run/lightdm/root/:2 -nolisten tcp # .../etc/lightdm.conf.d/71-seatdisplays.conf元のログイン方法でログインすると、状況は本当に複雑になりますseat0。最終的にはモニターに表示されますが、:0いずれにしてもseat0GPUとマウスとキーボードのUSBポートがモニターにバインドする信号を提供しますが、次のようになります。seat1seat2seat0 ❯ echo $DISPLAY :0 ❯ ps axo pid,user,args | grep xorg 6711 root /usr/lib/Xorg :1 -seat seat1 -auth /run/lightdm/root/:1 -nolisten tcp 6713 root /usr/lib/Xorg :2 -seat seat2 -auth /run/lightdm/root/:2 -nolisten tcp 6731 root /usr/lib/Xorg :0 -seat seat0 -auth /run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch ❯ loginctl list-sessions SESSION UID USER SEAT TTY 3 1000 myuser seat1 c1 958 lightdm seat2 c2 958 lightdm seat0 3 sessions listed. #行の末尾からコメントを削除するとxserver-command正確ですseat0が、結果が必ずしも表示されるわけではありません:0。実際に発生した内容を手動で設定したコマンドに自動的に追加し、最終的に正しい座席番号を取得すると、ディスプレイは再度ランダムに表示されます。 ❯ echo $DISPLAY :2 ❯ ps axo pid,user,args | grep xorg 6423 root /usr/lib/Xorg :1 -seat seat1 -auth /run/lightdm/root/:1 -nolisten tcp :0 -seat seat1 -auth /run/lightdm/root/:0 -nolisten tcp 6428 root /usr/lib/Xorg :2 -seat seat2 -auth /run/lightdm/root/:2 -nolisten tcp :1 -seat seat2 -auth /run/lightdm/root/:1 -nolisten tcp 6437 root /usr/lib/Xorg :0 -seat seat0 -auth /run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch :2 -seat seat0 -auth /run/lightdm/root/:2 -nolisten tcp vt7 -novtswitch ❯ loginctl list-sessions SESSION UID USER SEAT TTY 3 1000 myuser seat0 c1 958 lightdm seat1 c2 958 lightdm seat2 3 sessions listed. コマンドに必要なものを追加するように見えるので、xserver-commandfor andのような愚かな設定を試しましたが、これはandを中断しました。sleep 1; /usr/lib/Xorgseat12seat12 ❯ echo $DISPLAY :0 ❯ ps axo pid,user,args | grep xorg 6064 root /usr/lib/Xorg :0 -seat seat0 -auth /run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch ❯ loginctl list-sessions SESSION UID USER SEAT TTY 3 1000 myuser seat0 1 sessions listed. 私はそれが最初に:0などを取得するコマンドを実行または完了すると仮定できます。 seat0強制的に表示:0、seat1表示、表示する方法はありますか:1?seat2:2 seat1または開始を遅らせ、2常にseat0最初に解決する方法はありますか:0?

Admin

SSHを使用してnohup ffmpegコマンドを起動し、切断した後でも実行を続けるにはどうすればよいですか?
ssh
ffmpeg
nohup

SSHを使用してnohup ffmpegコマンドを起動し、切断した後でも実行を続けるにはどうすればよいですか?

SSHを介して一連のFFMPEGコマンドを実行しようとしています。私のSSHクライアントは、Windows Server 2019(バージョン1809ビルド17763.2114)のデフォルトのopenssh(7.7.2.1)クライアントです。私が実行したいコマンドは次のとおりです。 C:\Windows\System32\OpenSSH\ssh.exe -v [email protected] -n -t 'nohup /home/user1/ffmpeg/ffmpeg -f lavfi -i testsrc -f null - -nostdin -nostats -hide_banner -loglevel error &' 他のstackexchangeの答えは、「nohup」および「&」コマンドを使用すると、コマンドが開始されコンソールが解放されることを示します。私が直面した問題は、コマンドが実行されますが、コンソールがセッションを解放せずにコマンドを実行し続けることです。 行末に「\」を追加するとセッションは解放されますが、コマンドは停止します。 強制的に切断すると、ffmpeg コマンドは引き続き実行されますが、Powershell スクリプトを実行し続けるためにプロセスを解放する円滑な方法が必要です。これらすべてのコマンドを1行に保ちたいです。接続し、このコマンドを開始し、切断して実行を続けるにはどうすればよいですか?

Admin

SSHログイン公開鍵認証秘密鍵または公開鍵
ssh
key-authentication

SSHログイン公開鍵認証秘密鍵または公開鍵

-iSSHを使用してログインする場合、このオプションの値は何ですか? 以前は動作しているOpenBSDシステムに公開鍵を提供していましたが、Ubuntuシステムに入ろssh -i ~/.ssh/id_rsa.pubうとしたときに入るにはssh秘密鍵の場所を指定する必要がありました。ssh -i ~/.ssh/id_rsa sshのマニュアルページを読むと、秘密鍵が必要な場所がここにあることがわかりますが、以前公開鍵だけを使用してBSDシステムで機能していたのはなぜですか?

Admin

su パスワードを自動的に送信するには?
bash
ssh
password

su パスワードを自動的に送信するには?

に切り替えようとしたときに、以下のスクリプトからパスワードを自動的に送信するにはどうすればよいですかsu? 現在SSH経由でホスト名にログインでき、自動的にusingと入力しますssh passwordが、sshpassその過程で私に尋ねます。su password # sshpass -p 'ssh_password' ssh myuser@$hostname "su -c \"cd /some/path/ && ls -l\"" You are trying to access a restricted zone. Only Authorized Users allowed. Password: 似たようなことを試しましたが、うまくいきません。 sshpass -p 'ssh_password' ssh myuser@$hostname "su myuser su_password -c \"cd /documents/backups/ && ls\"" 以下に私がテストした3つの方法を示します。 3番目の方法だけを受け入れ、su_password残りの2つの方法はパスワードを要求し、パスワードを入力すると答えが出ます。su: incorrect password 1-) ユーザー名と su_password を使ってみました(失敗) # sshpass -p $ssh_password ssh -t $myuser@$hostname "su $myuser 'MysuPassword123' -c \"cd /some/path/ && ls\"" You are trying to access a restricted zone. Only Authorized Users allowed. Password: su: incorrect password Connection to AAA.BBB.CCC.DDD closed. 2-) ユーザー名のみで試みる(失敗) # sshpass -p $ssh_password ssh -t $myuser@$hostname "su $myuser -c \"cd /some/path/ && ls\"" You are trying to access a restricted zone. Only Authorized Users allowed. Password: su: incorrect password Connection to AAA.BBB.CCC.DDD closed. su3-)ユーザー名/su_passwordなしで試してみてください(成功) # sshpass -p $ssh_password ssh -t $myuser@$hostname "su -c \"cd /some/path/ && ls\"" You are trying to access a restricted zone. Only Authorized Users allowed. Password: docs file1 file2 Connection to AAA.BBB.CCC.DDD closed. どうすればいいですか?よろしくお願いします。

Admin

現在のディレクトリのすべてのフォルダとサブフォルダで、1つのフォルダ名を別のフォルダ名に置き換える方法は?
ssh
rename

現在のディレクトリのすべてのフォルダとサブフォルダで、1つのフォルダ名を別のフォルダ名に置き換える方法は?

「ギャラリー」というフォルダに多数のフォルダ(実際には500以上)があります。各フォルダには番号があり、番号付きの各ギャラリーフォルダにはサムネイルと画像用のフォルダがあります。しかし、以前のギャラリーは「コンテンツ/ラージ」と「コンテンツ/サムネイル」と呼ばれ、最新のギャラリーは「イメージ」と「サムネイル」と呼ばれていました。 PHPギャラリースクリプトを作成しているので、同じ名前のすべてのフォルダが必要です。 たとえば、現在、次のようなものがあります。 gallery/028/content/large gallery/028/content/thumbs 一部のフォルダと他のフォルダには次のものがあります。 gallery/029/images gallery/029/thumbnails したがって、最初に「large」という名前のすべてのフォルダを「images」に変更し、「thumbs」という名前のすべてのフォルダを「thumbnails」に変更する必要があります。 第二に、サブフォルダ「コンテンツ」内のすべてのフォルダを1つ上のレベルに移動したいと思います。 028/content/images 到着 028/images これにより、1つの画像のみを持つ番号付きのすべてのフォルダと、各ギャラリーのサムネイルと画像をそれぞれ含むサムネイルサブフォルダが作成されます。 私はこれをすべてSSHで実行しようとしています。サーバーから700GBを超えるデータをダウンロードする必要がないからです! 助けてくれてありがとう! カースティ

Admin

LAN接続のみsshdをARC4に設定できますか?
ssh
sshd

LAN接続のみsshdをARC4に設定できますか?

プライベートLAN内には、Raspbian(Raspbianに移植されたDebian)ベースのサーバーを実行する複数のRaspberry Piがあります。 Raspberry Piはハードウェア暗号化をサポートしていません。 sshdローカルサブネットでのみ高速暗号化(ARC4など)を許可するように設定できますか?少数の外部SSH接続に対して高レベルの暗号化を維持しますか?

Admin

sshd環境から新しいSSHセッションに環境変数を渡す方法は?
debian
ssh
sshd
aws
kubernetes

sshd環境から新しいSSHセッションに環境変数を渡す方法は?

sshd自分の環境の環境変数を新しいSSHセッションに渡すにはどうすればよいですか? sshd私はKubernetes Podで実行しています。 Kubernetes は、API サーバーを含むコンテナー環境でさまざまな変数を設定します。KUBERNETES_PORT=tcp://100.64.0.1:443 私の問題は、この環境変数が新しいSSHセッションに渡されず、構成に必要であることですkubectl。

Admin

SSH エージェント配信失敗
ssh
sshd
ssh-agent
forwarding

SSH エージェント配信失敗

DigitalOcean Dropletがあり、Githubでリポジトリを複製しようとしています。 これは私のローカルコンピュータでうまく機能し、Githubのガイドに従っています。 https://docs.github.com/en/developers/overview/using-ssh-agent-forwarding eval $(ssh-agent -s)サーバーでSSHプロキシを手動で有効にする必要がありましたが、サーバーがアクセスを使用できないため、わかる限りプロキシ転送は行われず、デバッグ出力は次のとおりです。ssh -T [email protected]ssh -v [email protected] OpenSSH_8.2p1 Ubuntu-4ubuntu0.5, OpenSSL 1.1.1f 31 Mar 2020 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files debug1: /etc/ssh/ssh_config line 21: Applying options for * debug1: Connecting to github.com [140.82.121.3] port 22. debug1: Connection established. debug1: identity file /root/.ssh/id_rsa type -1 debug1: identity file /root/.ssh/id_rsa-cert type -1 debug1: identity file /root/.ssh/id_dsa type -1 debug1: identity file /root/.ssh/id_dsa-cert type -1 debug1: identity file /root/.ssh/id_ecdsa type -1 debug1: identity file /root/.ssh/id_ecdsa-cert type -1 debug1: identity file /root/.ssh/id_ecdsa_sk type -1 debug1: identity file /root/.ssh/id_ecdsa_sk-cert type -1 debug1: identity file /root/.ssh/id_ed25519 type -1 debug1: identity file /root/.ssh/id_ed25519-cert type -1 debug1: identity file /root/.ssh/id_ed25519_sk type -1 debug1: identity file /root/.ssh/id_ed25519_sk-cert type -1 debug1: identity file /root/.ssh/id_xmss type -1 debug1: identity file /root/.ssh/id_xmss-cert type -1 debug1: Local version string SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.5 debug1: Remote protocol version 2.0, remote software version babeld-181fb29f debug1: no match: babeld-181fb29f debug1: Authenticating to github.com:22 as 'git' debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: algorithm: curve25519-sha256 debug1: kex: host key algorithm: ecdsa-sha2-nistp256 debug1: kex: server->client cipher: [email protected] MAC: compression: none debug1: kex: client->server cipher: [email protected] MAC: compression: none debug1: expecting SSH2_MSG_KEX_ECDH_REPLY debug1: Server host key: ecdsa-sha2-nistp256 SHA256:p2QAMXNIC1TJYWeIOttrVc98/R1BUFWu3/LiyKgUfQM The authenticity of host 'github.com (140.82.121.3)' can't be established. ECDSA key fingerprint is SHA256:p2QAMXNIC1TJYWeIOttrVc98/R1BUFWu3/LiyKgUfQM. Are you sure you want to continue connecting (yes/no/[fingerprint])? yes Warning: Permanently added 'github.com,140.82.121.3' (ECDSA) to the list of known hosts. debug1: rekey out after 134217728 blocks debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug1: SSH2_MSG_NEWKEYS received debug1: rekey in after 134217728 blocks debug1: Will attempt key: /root/.ssh/id_rsa debug1: Will attempt key: /root/.ssh/id_dsa debug1: Will attempt key: /root/.ssh/id_ecdsa debug1: Will attempt key: /root/.ssh/id_ecdsa_sk debug1: Will attempt key: /root/.ssh/id_ed25519 debug1: Will attempt key: /root/.ssh/id_ed25519_sk debug1: Will attempt key: /root/.ssh/id_xmss debug1: SSH2_MSG_EXT_INFO received debug1: kex_input_ext_info: server-sig-algs=<[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],ssh-ed25519,ecdsa-sha2-nistp521,ecdsa-sha2-nistp384,ecdsa-sha2-nistp256,rsa-sha2-512,rsa-sha2-256,ssh-rsa> debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey debug1: Next authentication method: publickey debug1: Trying private key: /root/.ssh/id_rsa debug1: Trying private key: /root/.ssh/id_dsa debug1: Trying private key: /root/.ssh/id_ecdsa debug1: Trying private key: /root/.ssh/id_ecdsa_sk debug1: Trying private key: /root/.ssh/id_ed25519 debug1: Trying private key: /root/.ssh/id_ed25519_sk debug1: Trying private key: /root/.ssh/id_xmss debug1: No more authentication methods to try. [email protected]: Permission denied (publickey). 私のローカルコンピュータでサーバーIPの設定エントリを作成しました。 Host x.x.x.x ForwardAgent yes また、サーバーのsshd_configファイルを次のように編集しました。 AllowAgentForwarding yes 次のコマンドを使用して、ローカルコンピュータにローカルキーを追加しました。ssh-add ~/.ssh/id_rsa 私は他に何をすべきかわからず、何時間もこの問題に悩んでいました。 (見つけることができるすべての内容を読んでいますが、役に立つものはありません。)

Admin