• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

How to disable bell on SSH connections

Scheduled Pinned Locked Moved General pfSense Questions
23 Posts 3 Posters 3.2k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G
    Gertjan @networknotwork
    last edited by Dec 27, 2021, 2:15 PM

    @networknotwork
    The bell generated by pfSense on the pfSense box when you login ?
    Or the bell generated by the SSH client when you 'syntax error' or provoke another non-no event ?

    No "help me" PM's please. Use the forum, the community will thank you.
    Edit : and where are the logs ??

    N 2 Replies Last reply Dec 27, 2021, 2:50 PM Reply Quote 0
    • N
      networknotwork @Gertjan
      last edited by Dec 27, 2021, 2:50 PM

      @gertjan The bell generated on error conditions (like trying to left arrow/delete past BOL)

      1 Reply Last reply Reply Quote 0
      • N
        networknotwork @Gertjan
        last edited by networknotwork Dec 27, 2021, 3:51 PM Dec 27, 2021, 3:50 PM

        @gertjan This may not be a pfsense issue but a Windows issue...ssh runs in a conhost instance which triggers the Windows Critical Stop sound on errors. Windows Terminal has a "disable bell" setting but a regular conhost command prompt window does not, as far as I can tell.

        G 1 Reply Last reply Dec 28, 2021, 9:07 AM Reply Quote 0
        • G
          Gertjan @networknotwork
          last edited by Dec 28, 2021, 9:07 AM

          @networknotwork

          I'm using Putty myself.
          I didn't look, but I'm pretty sure I can inform Putty that, upon reception of '07' == ASCII Bell, I can shut it down.

          Yep :

          77c0fc00-4760-4539-81c8-01d0e597c1a0-image.png

          No "help me" PM's please. Use the forum, the community will thank you.
          Edit : and where are the logs ??

          J N 2 Replies Last reply Dec 28, 2021, 2:02 PM Reply Quote 0
          • J
            johnpoz LAYER 8 Global Moderator @Gertjan
            last edited by johnpoz Dec 28, 2021, 3:08 PM Dec 28, 2021, 2:02 PM

            Ok here is a quick easy work around.

            after you ssh into pfsense create the .inputrc in what I would assume is the root home directory since that is typically is the account you ssh with (admin). Which is root.

            put in this file
            bell-style none

            bellstyle.jpg

            Now when you ssh to pfsense using the built in windows ssh, you should not get any bell.

            I tested via hearing the bell when hitting backspace while just at the prompt, and also you would hear it when you use tab to complete something. Once put in the .inputrc file setting bell none I no longer heard those.

            edit: This doesn't work - not sure what the F I was doing.. See solution later in thread with editing of .tcshrc file with beep setting.

            An intelligent man is sometimes forced to be drunk to spend time with his fools
            If you get confused: Listen to the Music Play
            Please don't Chat/PM me for help, unless mod related
            SG-4860 24.11 | Lab VMs 2.8, 24.11

            N 1 Reply Last reply Dec 28, 2021, 2:12 PM Reply Quote 0
            • N
              networknotwork @johnpoz
              last edited by networknotwork Dec 28, 2021, 2:13 PM Dec 28, 2021, 2:12 PM

              @johnpoz already tried that, didn’t work; I think .inputrc only works for readline, which seems to be a Linux thing? FreeBSD has the kbdcontrol -b off command, which didn’t work either. Weirdly, OpenSSH is presenting itself as an xterm256 terminal, so maybe xset could silence the infernal bell but it’s not installed on pfsense. Anyway I fixed it by muting conhost in the volume mixer!

              J 1 Reply Last reply Dec 28, 2021, 2:17 PM Reply Quote 0
              • N
                networknotwork @Gertjan
                last edited by Dec 28, 2021, 2:17 PM

                @gertjan yes, the new Windows Terminal has that option too but the old Windows Console Host (conhost) doesn’t.

                1 Reply Last reply Reply Quote 0
                • J
                  johnpoz LAYER 8 Global Moderator @networknotwork
                  last edited by Dec 28, 2021, 2:17 PM

                  @networknotwork not sure what your using/doing then... Because I tested this by opening a cmd prompt in windows 10, ssh to pfsense and heard the bell you were talking about when I just just backspace at the prompt. Or when I did a tab autocomplete..

                  I then created the .inputrc and no more bell. After I re ssh'd in..

                  An intelligent man is sometimes forced to be drunk to spend time with his fools
                  If you get confused: Listen to the Music Play
                  Please don't Chat/PM me for help, unless mod related
                  SG-4860 24.11 | Lab VMs 2.8, 24.11

                  N 1 Reply Last reply Dec 28, 2021, 2:19 PM Reply Quote 0
                  • N
                    networknotwork @johnpoz
                    last edited by Dec 28, 2021, 2:19 PM

                    @johnpoz yep did that, but will try again. Are you using the Windows built in ssh (bundled starting with 1809 I think) or another ssh client?

                    J 2 Replies Last reply Dec 28, 2021, 2:20 PM Reply Quote 0
                    • J
                      johnpoz LAYER 8 Global Moderator @networknotwork
                      last edited by johnpoz Dec 28, 2021, 2:31 PM Dec 28, 2021, 2:20 PM

                      @networknotwork hold - you might be right ;) stupid me was hitting enter not backspace..

                      doh! Well shit! ;)

                      sorry about that - need more coffee I guess ;)

                      An intelligent man is sometimes forced to be drunk to spend time with his fools
                      If you get confused: Listen to the Music Play
                      Please don't Chat/PM me for help, unless mod related
                      SG-4860 24.11 | Lab VMs 2.8, 24.11

                      1 Reply Last reply Reply Quote 0
                      • J
                        johnpoz LAYER 8 Global Moderator @networknotwork
                        last edited by johnpoz Dec 28, 2021, 2:41 PM Dec 28, 2021, 2:37 PM

                        @networknotwork ok I think I got it ;)

                        in your .tcshrc file at the end add

                        set nobeep

                        this seems to have done it.

                        tested with ssh that is part of windows

                        C:\>ver
                        
                        Microsoft Windows [Version 10.0.19044.1415]
                        
                        C:\>ssh -V
                        OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2
                        

                        Or if you like your file to be a bit cleaner looking in the area where its setting prompt and stuff you could add the nobeep

                        An intelligent man is sometimes forced to be drunk to spend time with his fools
                        If you get confused: Listen to the Music Play
                        Please don't Chat/PM me for help, unless mod related
                        SG-4860 24.11 | Lab VMs 2.8, 24.11

                        N 1 Reply Last reply Dec 28, 2021, 2:45 PM Reply Quote 1
                        • N
                          networknotwork @johnpoz
                          last edited by networknotwork Dec 28, 2021, 2:56 PM Dec 28, 2021, 2:45 PM

                          @johnpoz not at my PC but this sounds right, so dang difficult to find stuff specific for tcsh/FreeBSD, just get a deluge of bash/Linux hits…I literally googled (well, DDG’ed) “disable tcsh bell” and didn’t find this.

                          J G 2 Replies Last reply Dec 28, 2021, 3:12 PM Reply Quote 1
                          • J
                            johnpoz LAYER 8 Global Moderator @networknotwork
                            last edited by johnpoz Dec 28, 2021, 3:15 PM Dec 28, 2021, 3:12 PM

                            @networknotwork btw, I tested this with ssh from openssh for windows as well, and it still works - since its related to the shell (tcsh)

                            C:\>ssh -V
                            OpenSSH_8.8p1, OpenSSL 1.1.1l  24 Aug 2021
                            

                            Not sure why the windows built in ssh is so far behind..

                            Just got a fancy new PC, and still working on getting all the stuff back to the way I like it.. Upon testing this and seeing that the windows version ssh that comes with was so far behind it was time to correct that ;) I normally just use securecrt for my ssh needs, but now and then you need to do stuff from just the command line

                            An intelligent man is sometimes forced to be drunk to spend time with his fools
                            If you get confused: Listen to the Music Play
                            Please don't Chat/PM me for help, unless mod related
                            SG-4860 24.11 | Lab VMs 2.8, 24.11

                            1 Reply Last reply Reply Quote 0
                            • G
                              Gertjan @networknotwork
                              last edited by Dec 28, 2021, 3:30 PM

                              @networknotwork said in How to disable bell on SSH connections:

                              difficult to find stuff specific for tcsh/FreeBSD

                              It's here https://www.freebsd.org/cgi/man.cgi?tcsh(1).

                              I've been looking for the beep one myself quiet often, and was thrown of track because what the first line in /etc/passws says : your shell is /bin/sh

                              But ... when 'root' (or 'admin') logs in, /bin/sh uses /root/.profile that will kick of /etc/rc.initial. rc.initial shows the 'asccii pfsense' menu.
                              Option 8 of this script will kick of another shell, this time /bin/tcsh

                              Btw : files like /root/.tcshrc will get overwritten what updating / upgrading and maybe during other circumstances.

                              No "help me" PM's please. Use the forum, the community will thank you.
                              Edit : and where are the logs ??

                              J N 2 Replies Last reply Dec 28, 2021, 3:32 PM Reply Quote 0
                              • J
                                johnpoz LAYER 8 Global Moderator @Gertjan
                                last edited by Dec 28, 2021, 3:32 PM

                                @gertjan said in How to disable bell on SSH connections:

                                files like /root/.tcshrc will get overwritten what updating / upgrading and maybe during other circumstances.

                                quite true.. so need to keep that in mind going forward.

                                An intelligent man is sometimes forced to be drunk to spend time with his fools
                                If you get confused: Listen to the Music Play
                                Please don't Chat/PM me for help, unless mod related
                                SG-4860 24.11 | Lab VMs 2.8, 24.11

                                N 1 Reply Last reply Dec 28, 2021, 3:35 PM Reply Quote 0
                                • N
                                  networknotwork @johnpoz
                                  last edited by Dec 28, 2021, 3:35 PM

                                  @johnpoz maybe you guys should just add this to the default .tcshrc :-) I doubt anyone likes the bell!

                                  J 1 Reply Last reply Dec 28, 2021, 3:52 PM Reply Quote 0
                                  • N
                                    networknotwork @Gertjan
                                    last edited by Dec 28, 2021, 3:48 PM

                                    @gertjan I think /bin/sh in passwd is there for some weird compatibility/historical reasons; it’s usually symlinked to another shell like tcsh/bash in the file system, I don’t think any distro still uses the original sh; the default on FreeBSD is tcsh

                                    G 1 Reply Last reply Dec 28, 2021, 4:03 PM Reply Quote 0
                                    • J
                                      johnpoz LAYER 8 Global Moderator @networknotwork
                                      last edited by Dec 28, 2021, 3:52 PM

                                      @networknotwork said in How to disable bell on SSH connections:

                                      I doubt anyone likes the bell!

                                      hehehe - you never know ;) But sure you could put in a feature request to have that as an option you could turn off or on in the gui..

                                      They have it where you can turn off the bootup/shutdown beep

                                      notifications.jpg

                                      I would think they could add a option where you configure ssh access to disable that beep ;)

                                      An intelligent man is sometimes forced to be drunk to spend time with his fools
                                      If you get confused: Listen to the Music Play
                                      Please don't Chat/PM me for help, unless mod related
                                      SG-4860 24.11 | Lab VMs 2.8, 24.11

                                      N 1 Reply Last reply Dec 28, 2021, 5:27 PM Reply Quote 0
                                      • G
                                        Gertjan @networknotwork
                                        last edited by Dec 28, 2021, 4:03 PM

                                        @networknotwork said in How to disable bell on SSH connections:

                                        I don’t think any distro still uses the original sh

                                        Think again.

                                        dump /bin/sh yourself.
                                        The binary will ID itself to you.
                                        It no sym link.

                                        It's 'sh'.

                                        No "help me" PM's please. Use the forum, the community will thank you.
                                        Edit : and where are the logs ??

                                        N 1 Reply Last reply Dec 28, 2021, 5:29 PM Reply Quote 0
                                        • N
                                          networknotwork @johnpoz
                                          last edited by Dec 28, 2021, 5:27 PM

                                          @johnpoz is there a feature request/bug report board? Couldn't find one. Anway, while editing .tcshrc I found a bug: it checks for $term == "xterm" to set key bindings, it should be $term =~ "xterm" to account for xterm-256color etc.

                                          Command line editing wasn't working properly before I made this change, inserting appeared like it was overwriting (not pushing rest of line to the right as I typed) but was actually inserting my typed chars into the line.

                                          J 1 Reply Last reply Dec 28, 2021, 5:30 PM Reply Quote 0
                                          21 out of 23
                                          • First post
                                            21/23
                                            Last post
                                          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                                            This community forum collects and processes your personal information.
                                            consent.not_received