Ошибка error 255

The SSH (Secure Shell) script is a powerful tool for accessing remote servers and performing various operations on them. However, sometimes when you run an SSH script, it returns an error code of 255. This error code indicates that the remote server has rejected the connection and the script execution has failed. There are several reasons why the remote server may reject the connection, including incorrect authentication information, firewall restrictions, or an unstable network connection.

Method 1: Check the Authentication Information

To fix the «ssh script returns 255 error» in Linux, you can check the authentication information. Here are the steps to do so:

  1. Check the user’s permissions and ensure that they have the necessary access to the remote server.
ls -la ~/.ssh/
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
  1. Verify that the authentication keys are correctly installed and that the permissions are set correctly.
cat ~/.ssh/id_rsa.pub | ssh user@hostname 'cat >> ~/.ssh/authorized_keys'
  1. Ensure that the SSH server is running and that the firewall is not blocking the connection.
systemctl status sshd
firewall-cmd --list-all
  1. Check the SSH logs for any errors or issues.
  1. Try connecting to the remote server manually and see if there are any errors.

By following these steps, you should be able to fix the «ssh script returns 255 error» in Linux.

Method 2: Check Firewall Restrictions

If you are encountering a «ssh script returns 255 error» in Linux, it may be due to firewall restrictions. Here’s how to fix it:

Step 1: Check Firewall Restrictions

First, check if there are any firewall restrictions that may be causing the error. You can do this by running the following command:

This will show you the current status of your firewall. If it is active, you may need to allow SSH connections through the firewall. You can do this by running the following command:

Step 2: Test SSH Connection

Next, test your SSH connection to see if the error has been resolved. You can do this by running the following command:

Replace «user» with your username and «server» with the name or IP address of the server you are trying to connect to.

If you are still encountering the «ssh script returns 255 error», you may need to check your SSH configuration or consult with your system administrator.

Method 3: Stabilize the Network Connection

To stabilize the network connection and fix the ssh script returns 255 error on Linux, follow these steps:

  1. Set up a keepalive interval on the client side by editing the ssh_config file:
sudo nano /etc/ssh/ssh_config

Add the following line at the end of the file:

This will send a keepalive packet every 60 seconds to keep the connection alive.

  1. Set up a keepalive interval on the server side by editing the sshd_config file:
sudo nano /etc/ssh/sshd_config

Add the following line at the end of the file:

This will send a keepalive packet every 60 seconds to keep the connection alive.

  1. Restart the ssh service on both the client and server side:
  1. Test the connection by running the ssh script again.

Here’s an example of what the edited ssh_config and sshd_config files would look like:

/etc/ssh/ssh_config

/etc/ssh/sshd_config

With these changes, the ssh connection should be more stable and the script should no longer return a 255 error.

Method 4: Debug the Script for Errors

When dealing with SSH scripts returning a 255 error, debugging the script for errors is a good approach. Here are the steps to do it:

  1. Check the syntax of the script. Run bash -n scriptname.sh to check for syntax errors.

  2. Add set -x at the beginning of the script to enable debugging mode. This will print each command as it is executed.

  3. Run the script again and check for errors in the output. Look for any command that might be failing.

  4. Use echo statements to print out variables and values to help identify where the error might be occurring.

Here is an example script with debugging enabled:

#!/bin/bash
set -x

ssh user@remote-server "echo Hello World"

In this example, the set -x command will print out each command as it is executed. If there is an error with the SSH connection, it will be apparent in the output.

Debugging scripts for errors can be time-consuming, but it is an effective way to identify and fix issues. By following these steps and using the set -x command, you can quickly identify the source of the error and resolve it.

Are you struggling with sftp error code 255?

SFTP is a secure method for file upload.

However, it often shows errors when the remote server is down/unavailable, the remote machine doesn’t have ssh access or has firewall restrictions.

At Bobcares, we often get requests from our customers to fix an error message sftp error code 255 as part of our Server Management Services.

Today, let’s get into the details on how our Support Engineers fix this error.

Why sftp error code 255?

Usually, the exit code 255 is a frequent error that happens due to the problem in SSH access.

The error appears like the following

SFTP error 255

The following reasons are the common cause of this error.

If the remote server to which we are trying to connect is unavailable or down, then the connection via sftp has not been established, and so we received this error.

In addition to this, we will get the same error if the remote server is not having the ssh access to the server or if there is any firewall restriction.

Now let’s detail the reason for this error and how our Support Engineers fix the problem.

The causes and fixes of sftp error code 255

At Bobcares, where we have more than a decade of expertise in managing servers, we see many customers facing problems with error sftp error code 255.

Now, let’s see the major reasons for this sftp related errors and how our Support Engineers fix them.

1. Missing RSA key

Recently, while connecting to the server via sftp one of our customers was getting the error sftp error code 255. Initially, his public key authentication was successful. But after a while, the connection got disconnected.

On checking, our Support Engineers found that the public key was working and could not trace anything wrong with it. However, we found that he had only created DSA keys, and RSA keys were missing.

Therefore, we created RSA keys and also inserted the public keys in his authorized keys file, then everything worked fine.

This resolved the error and the customer could regain sftp connection.

2. Firewall restrictions

Firewall restrictions can also be a reason for sftp failure. It will restrict unauthorized IP access or port access to the server for security purposes.

Sometimes, the error sftp error code 255 happens due to the sftp port restricted in the firewall. In such cases, our Support Engineers will first check for any firewall restrictions. Firewall restrictions can cause timeout errors while trying to connect to the server using sftp.

This has been caused due to some server-side settings or sftp port (default 22)blocks on the network.

So, our Support Engineers check the log files and confirm that it does not cause the sftp to exit connection.

For instance, we check the IPtables to see if there are any IP restrictions.

iptables -nL | grep xx.xx.xx.xx

If so, we will remove the IP restrictions to fix this error.

3. Permission of sftp

Sometimes, if there was no sftp server on the remote end, customers will receive the same error. Here, our Support Engineers confirm the working of the sftp server.

Another important cause to receive this error is incorrect permission of /home/user and .ssh folder on the remote server.

Here, we check the permission of the user and .ssh folder and correct it as follows.

chmod 755 /home/user
chmod 700 /home/user/.ssh

Generally, the /home/user folder should be with 755 permission and the .ssh folder is with 700 permission.

By ensuring this, we can avoid unwanted errors happens while connected to the remote server via sftp.

[Struggling with sftp connection errors? We are here to help you.]

Conclusion

In short, sftp error code 255 error has been received mainly due to the problems in the remote server such as missing RSA keys, firewall restrictions, and so on. Today we discussed the reasons causing sftp error code 255 and saw how our Support Engineers fix this error for our customers.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = «owonCMyG5nEQ0aD71QM»;

In my code I have the following to run a remote script.

ssh root@host.domain.com "sh /home/user/backup_mysql.sh"

For some reason it keeps 255’ing on me. Any ideas?

I can SSH into the box just fine (passless keys setup)

REMOTE SCRIPT:

MUSER='root' 
MPASS='123123'
MHOST="127.0.0.1"
VERBOSE=0

### Set bins path ###
GZIP=/bin/gzip
MYSQL=/usr/bin/mysql
MYSQLDUMP=/usr/bin/mysqldump
RM=/bin/rm
MKDIR=/bin/mkdir
MYSQLADMIN=/usr/bin/mysqladmin
GREP=/bin/grep

### Setup dump directory ###
BAKRSNROOT=/.snapshots/tmp

#####################################
### ----[ No Editing below ]------###
#####################################
### Default time format ###
TIME_FORMAT='%H_%M_%S%P'

### Make a backup ###
backup_mysql_rsnapshot(){
        local DBS="$($MYSQL -u $MUSER -h $MHOST -p$MPASS -Bse 'show databases')"
        local db="";
        [ ! -d $BAKRSNROOT ] && ${MKDIR} -p $BAKRSNROOT
        ${RM} -f $BAKRSNROOT/* >/dev/null 2>&1
#       [ $VERBOSE -eq 1 ] && echo "*** Dumping MySQL Database ***"
#       [ $VERBOSE -eq 1 ] && echo -n "Database> "
        for db in $DBS
        do
                local tTime=$(date +"${TIME_FORMAT}")
                local FILE="${BAKRSNROOT}/${db}.${tTime}.gz"
#               [ $VERBOSE -eq 1 ] && echo -n "$db.."
                ${MYSQLDUMP} --single-transaction -u ${MUSER} -h ${MHOST} -p${MPASS} $db | ${GZIP} -9 > $FILE
        done
#               [ $VERBOSE -eq 1 ] && echo ""
#               [ $VERBOSE -eq 1 ] && echo "*** Backup done [ files wrote to $BAKRSNROOT] ***"
}

### Die on demand with message ###
die(){
        echo "$@"
        exit 999
}

### Make sure bins exists.. else die
verify_bins(){
        [ ! -x $GZIP ] && die "File $GZIP does not exists. Make sure correct path is set in $0."
        [ ! -x $MYSQL ] && die "File $MYSQL does not exists. Make sure correct path is set in $0."
        [ ! -x $MYSQLDUMP ] && die "File $MYSQLDUMP does not exists. Make sure correct path is set in $0."
        [ ! -x $RM ] && die "File $RM does not exists. Make sure correct path is set in $0."
        [ ! -x $MKDIR ] && die "File $MKDIR does not exists. Make sure correct path is set in $0."
        [ ! -x $MYSQLADMIN ] && die "File $MYSQLADMIN does not exists. Make sure correct path is set in $0."
        [ ! -x $GREP ] && die "File $GREP does not exists. Make sure correct path is set in $0."
}

### Make sure we can connect to server ... else die
verify_mysql_connection(){
        $MYSQLADMIN  -u $MUSER -h $MHOST -p$MPASS ping | $GREP 'alive'>/dev/null
        [ $? -eq 0 ] || die "Error: Cannot connect to MySQL Server. Make sure username and password are set correctly in $0"
}

### main ####
verify_bins
verify_mysql_connection
backup_mysql_rsnapshot

5

This is usually happens when the remote is down/unavailable; or the remote machine doesn’t have ssh installed; or a firewall doesn’t allow a connection to be established to the remote host.

ssh returns 255 when an error occurred or 255 is returned by the remote script:

 EXIT STATUS

     ssh exits with the exit status of the remote command or
     with 255 if an error occurred.

Usually you would an error message something similar to:

ssh: connect to host host.domain.com port 22: No route to host

Or

ssh: connect to host HOSTNAME port 22: Connection refused

Check-list:

  • What happens if you run the ssh command directly from the command line?

  • Are you able to ping that machine?

  • Does the remote has ssh installed?

  • If installed, then is the ssh service running?

answered Feb 14, 2013 at 23:30

P.P's user avatar

6

This error will also occur when using pdsh to hosts which are not contained in your «known_hosts» file.

I was able to correct this by SSH’ing into each host manually and accepting the question «Do you want to add this to known hosts».

1

If there’s a problem with authentication or connection, such as not being able to read a password from the terminal, ssh will exit with 255 without being able to run your actual script. Verify to make sure you can run ‘true’ instead, to see if the ssh connection is established successfully.

answered Feb 14, 2013 at 23:28

that other guy's user avatar

that other guythat other guy

117k11 gold badges170 silver badges195 bronze badges

Isn’t the problem in the lines:

### Die on demand with message ###
die(){
  echo "$@"
  exit 999
}

Correct me if I’m wrong but I believe exit 999 is out of range for an exit code and results in a exit status of 255.

1

I was stumped by this. Once I got passed the 255 problem… I ended up with a mysterious error code 1. This is the foo to get that resolved:

 pssh -x '-tt' -h HOSTFILELIST -P "sudo yum -y install glibc"

-P means write the output out as you go and is optional. But the -x ‘-tt’ trick is what forces a psuedo tty to be allocated.

You can get a clue what the error code 1 means this if you try:

ssh AHOST "sudo yum -y install glibc"

You may see:

[slc@bastion-ci ~]$ ssh MYHOST "sudo yum -y install glibc"
sudo: sorry, you must have a tty to run sudo
[slc@bastion-ci ~]$ echo $?
1

Notice the return code for this is 1, which is what pssh is reporting to you.

I found this -x -tt trick here. Also note that turning on verbose mode (pssh —verbose) for these cases does nothing to help you.

It can very much be an ssh-agent issue.
Check whether there is an ssh-agent PID currently running with eval "$(ssh-agent -s)"

Check whether your identity is added with ssh-add -l and if not, add it with ssh-add <pathToYourRSAKey>.

Then try again your ssh command (or any other command that spawns ssh daemons, like autossh for example) that returned 255.

### Die on demand with message ###
die(){
        echo "$@"
        exit 999
}

I don’t have the rep to comment on Alex’s answer but the exit 999 line returns code 231 on my WSL Ubuntu 20.04.4 box. Not quite sure why that is returned but I understand that it’s out of range.

1

Обновление драйверов устройств будет эффективным для многих пользователей

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

ИксУСТАНОВИТЕ, НАЖИМАЯ НА СКАЧАТЬ ФАЙЛ

Легко избавиться от ошибок WindowsFortect — это инструмент для восстановления системы, который может сканировать всю вашу систему на наличие поврежденных или отсутствующих файлов ОС и автоматически заменять их рабочими версиями из своего репозитория. Повысьте производительность вашего ПК, выполнив три простых шага:

  1. Скачайте и установите Фортект на вашем ПК.
  2. Запустите инструмент и Начать сканирование
  3. Щелкните правой кнопкой мыши Ремонт, и исправить это в течение нескольких минут.
  • 0 читатели уже скачали Fortect в этом месяце

Несколько наших читателей жаловались на получение следующей ошибки: Ошибка выполнения 255. Произошла неожиданная ошибка. Обратитесь за помощью в техническую поддержку программы.

Даже если это сообщение об ошибке имеет небольшие вариации в зависимости от вызывающих его программ, решения часто очень похожи.

Что такое ошибка времени выполнения 255?

Это ошибка, которая возникает во время работы или выполнения программы и может быть вызвана следующими причинами:

  • Поврежденные или отсутствующие файлы – Программы с поврежденные или отсутствующие компоненты файла выдает ошибку при запуске.
  • Аппаратные проблемы – Аппаратное обеспечение компьютера, такое как неисправный жесткий диск или модуль памяти, также может вызывать ошибку выполнения 255.
  • Программные конфликты – Для некоторых пользователей триггером являются две программы, пытающиеся получить доступ к одним и тем же ресурсам на компьютере.
  • Устаревшие драйверы – Если на вашем компьютере устаревшие драйверы для определенных программ вы, вероятно, получите ошибку времени выполнения во время выполнения программы.
  • Вирусы или вредоносное ПО — На вашем устройстве могут быть файлы, поврежденные вредоносным ПО, что приводит к ошибке.

Как исправить ошибку выполнения 255?

Вы должны начать со следующих обходных путей:

  • Просканируйте компьютер на наличие вирусов, чтобы устранить ошибку, связанную с заражением вредоносным ПО.
  • Удалить приложения это может вызвать конфликты; это могут быть ваши недавно установленные приложения.
  • Если вы столкнулись с ошибкой, попробуйте перезагрузить компьютер. Иногда временные проблемы с оборудованием или программным обеспечением можно решить простым перезапуском.

Теперь вы можете приступить к подробным исправлениям, если вышеуказанные предварительные решения не работают.

  1. Щелкните правой кнопкой мыши меню «Пуск» и выберите Диспетчер устройств.
    ошибка выполнения 255
  2. Разверните категорию, связанную с ошибкой выполнения, щелкните правой кнопкой мыши драйвер и выберите Обновить драйвер.
    ошибка выполнения 255
  3. Выбирать Автоматический поиск драйверов.
    ошибка выполнения 255
  4. Следуйте инструкциям, чтобы завершить обновление.

Кроме того, вы можете автоматически обновлять драйверы ПК и избежать каких-либо трудностей, связанных с ручным процессом.

Мы настоятельно рекомендуем вам использовать это автономное приложение для драйверов и находить или обновлять драйверы одним щелчком мыши.

Получить DriverFix

2. Запустить сканирование файла

  1. Нажимать Окна + р открыть Бегать диалог.
  2. Тип команда и ударил Ctrl + Сдвиг + Входить открыть возвышенный Командная строка.
    ошибка выполнения 255
  3. Введите скрипт ниже и нажмите Входить.
  4. Дождитесь завершения сканирования, перезапустите устройство и проверьте, исправляет ли оно ошибку времени выполнения 255.
Подробнее об этой теме

  • Ошибка выполнения 57121: определяется приложением или объектом [Fix]
  • Ошибка выполнения 62: ввод за концом файла [исправлено]

3. Переустановите приложение

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

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

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

Мы написали руководство по Ошибка выполнения Microsoft Visual C++. Некоторые из исправлений могут быть применимы.

Любое решение в этом руководстве должно устранить ошибку, но нам любопытно узнать, что сработало для вас. Поэтому, пожалуйста, дайте нам знать, используя раздел комментариев ниже.

Все еще испытываете проблемы?

СПОНСОР

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

Updating device drivers will be effective for many users

by Afam Onyimadu

Afam is a geek and the go-to among his peers for computer solutions. He has a wealth of experience with Windows operating systems, dating back to his introduction… read more


Updated on

  • A runtime error ocvure during program execution, and will often have a notification specifying the related application. 
  • Corrupted or missing files, hardware problems, malware, or conflicting software applications may cause the error.

XINSTALL BY CLICKING THE DOWNLOAD FILE

To fix Windows PC system issues, you will need a dedicated tool

SPONSORED

Fortect is a tool that does not simply clean up your PC, but has a repository with several millions of Windows System files stored in their initial version. When your PC encounters a problem, Fortect will fix it for you, by replacing bad files with fresh versions. To fix your current PC issue, here are the steps you need to take:

  1. Download Fortect and install it on your PC.
  2. Start the tool’s scanning process to look for corrupt files that are the source of your problem
  3. Right-click on Start Repair so the tool could start the fixing algorythm
  • Fortect has been downloaded by 0 readers this month, rated 4.4 on TrustPilot

A few of our readers have complained about receiving the following error: Runtime Error 255. An unexpected error has occurred. Please contact the program’s technical support for assistance.

Even when this error message has slight variations depending on the programs causing it, the solutions are often very similar.

What is runtime error 255?

This is an error that occurs while a program runs or is executing and may be caused by the following:

  • Corrupted or missing files – Programs with corrupt or missing file components will trigger the error when launched.
  • Hardware problems – Computer hardware, such as a faulty hard drive or memory module, can also cause Runtime Error 255.
  • Software conflicts – For some users, the trigger is two programs trying to access the same resources on the computer.
  • Outdated drivers – If your computer has outdated drivers for specific programs, you will likely get a runtime error during program execution.
  • Viruses or malware – You may have files damaged by malware on your device, leading to the error.

How do I fix runtime error 255?

You should start with the following workarounds:

  • Scan the computer for viruses to eliminate the error due to malware infection.
  • Uninstall apps that may cause conflicts; these may be your more recently installed applications.
  • If you’re experiencing an error, try restarting your computer. Sometimes, temporary issues with your hardware or software can be resolved through a simple restart.

Now, you may proceed with detailed fixes if the above pre-solutions do not work.

  1. Right-click on the Start menu and select Device Manager.
    runtime error 255
  2. Expand the category related to the runtime error, right-click on your driver, and select Update driver.
    runtime error 255
  3. Select Search automatically for drivers.
    runtime error 255
  4. Follow the steps to complete the update.

In addition, you can update your PC drivers automatically and avoid any difficulties from using the manual process.

We highly encourage you to utilize this standalone driver application and find or update drivers with one click.

⇒ Get Outbyte Driver Updater

2. Run a file scan

  1. Press Windows + R to open the Run dialog.
  2. Type cmd and hit Ctrl + Shift + Enter to open an elevated Command Prompt.
    runtime error 255
  3. Type the script below and hit Enter.
  4. Wait for the scan to complete, restart the device and verify if it fixes the runtime error 255.
Read more about this topic

  • 4 Ways to Fix LiveKernelEvent 144 Error on Windows 11
  • Fix: Secure Boot is Greyed Out on Windows 11
  • Fix: Touchpad Clicks but Doesn’t Move on Windows 11
  • Fix: No Internet, Secured Error on Windows 11
  • Fix: Keyboard Shortcuts are Not Working in Photoshop

3. Reinstall the application

Since the runtime error 255 often comes with an error code pointing to the problematic program, you may reinstall the problematic application.

However, you must reinstall a freshly downloaded copy of the application, as the old copy may be corrupted and unusable.

If you have tried all the solutions in this guide, you may consider contacting the program’s technical support assistant for more help.

We have written a guide on the Microsoft Visual C++ Runtime Error. A few of the fixes may be applicable.

Any solution in this guide should be able to resolve the error, but we are curious to know what worked for you. So, please let us know using the comment section below.

newsletter icon

Понравилась статья? Поделить с друзьями:
  • Ошибка er10 hp 134
  • Ошибка error 2015
  • Ошибка er26 варочной поверхности bosch
  • Ошибка er1 на терморегуляторе
  • Ошибка error 23 на магнитоле пионер флешка