0

I have installed Ubuntu Touch on Nexus 4, and I am loving it. I want to ssh into my phone using password, so I would like to delete the ssh override file, which is /etc/init/ssh.override However, the following is what I get when I attempt to remove the override file:

$ sudo rm /etc/init/ssh.override
rm: cannot remove '/etc/init/ssh.override': Device or resource busy

Why is it so? I can by the way modify this file to delete the override option, but cannot move or remove the file itself. So, my question is why can I not delete this file? BTW I have enabled read/write on this phone.

Thanks in advance.

2
  • why would you like to remove it?
    – Jakuje
    Mar 30, 2016 at 19:30
  • well, i should be able to take control of the system fully as a superuser. i should be able to remove any file i want, but i can't here. so i am just curious why i cannot remove this file. i am just trying to learn the system, not so much to remove this particular file. what is preventing it from being deleted systemwise? Mar 31, 2016 at 0:33

2 Answers 2

0

Isn't the filesystem readinly?

Try 'sudo mount -o remount,rw /' to make it writable.

Afterwards make it readonly again by 'sudo mount -o remount,ro /'

1
  • Nope, the filesystem is not read-only. I can "edit" the content of the file /etc/init/ssh.override, but I cannot delete or move or rename it. Apr 1, 2016 at 9:34
0

I created a custom upstart service in /etc/init, for instance /etc/init/myssh.conf which is basically a copy of ssh.conf

    description     "SSH server"

start on runlevel [2345]
stop on runlevel [!2345]

respawn
respawn limit 10 5
umask 022

env SSH_SIGSTOP=1
expect stop

# 'sshd -D' leaks stderr and confuses things in conjunction with 'console log'
console none

pre-start script
    test -x /usr/sbin/sshd || { stop; exit 0; }

    mkdir -p -m0755 /var/run/sshd
end script

# if you used to set SSHD_OPTS in /etc/default/ssh, you can change the
# 'exec' line here instead
exec /usr/sbin/sshd -D

Because of start on runlevel [2345] this customized "myssh" service will start automatically after a reboot and the ssh options will not be overriden by ssh.override (I wasn't able to delete it). It is now possible to ssh using a password (as long as /etc/ssh/sshd_config allows it).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .